Well I needed some help with my C++ programming and decided to join this forum. I enjoy learning new things. This is my first post and you may all just call me "Muner".
I have a programming class which I am beginning to struggle. Now one of my assignments was find all the errors in a code and comment on what is wrong.
This is the code to clean up:
Code:
//Specification: Display a menu
//Find Errors in this program
#include <io>
main ( )
}
cout >> "Choose From Martha's Menu:/n"
cout << "1 - Dinner"
cout << endln << 2 - Lunch";
cout << endln << "3 - Breakfast";
cout << "Enter a number:"
int Choice = 0;
cin << choice
cout << "\n You Choose " << choice;
return 0;
}
Now this is what I was able to find:
Code:
//Specification: Display a menu
//Find Errors in this program
#include <iostream>
using namespace std;
int main ( )
{
cout << "Choose From Martha\'s Menu:/n";
cout << "1 - Dinner";
cout << endl << "2 - Lunch"; // doesn't "endl" have to be in the end?
cout << endl << "3 - Breakfast";
cout << "Enter a number: ";
int Choice = 0;
cin >> choice
cout << "You Choose /n" << choice;
return 0;
}
I did not add comments to the ones I was able to find, but if someone could explain so I can understand this a lot better would be appreciated.