if (choice !=5)
{
cout << "I'm sorry but that is not available!" << endl;
You forgot to add a closing brace.
system("PAUSE");
return 0;
You never ended the do loop; do loops require a closing brace and a while statement to follow.
And lastly, you never ended the main function! A closing brace is all that's needed.
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
Here's something that you might find useful. Because the description of the problem isnt really the clearest it could be, I made this little program up to help you understand what should happen. Its using a functino called DoMenu which displays the menu and gets input from there.
#include <iostream>
using namespace std;
int DoMenu();
int main()
{
int choice;
do
{
choice = DoMenu();
switch (choice)
{
case 1: cout << "addition\n"; break;
case 2: cout << "subtraction\n"; break;
case 3: cout << "multiplication\n"; break;
case 4: cout << "division\n"; break;
case 5: cout << "quit\n"; break;
default : cout << "Error input\n";
}
} while (choice != 5);
return 0;
}
int DoMenu()
{
int MenuChoice;
cout << " MENU\n";
cout << " 1. Addition\n";
cout << " 2. Subtraction\n";
cout << " 3. Multiplication\n";
cout << " 4. Division\n";
cout << " 5. Quit the program\n";
cout << "_____________________\n";
cin >> MenuChoice;
return MenuChoice;
}
may4life
Junior Poster in Training
57 posts since Oct 2006
Reputation Points: 13
Solved Threads: 2
A. You are responding to a three year old post
B. You are hijacking that thread with a new problem
C. You are asking for a solution to a problem you have not attempted to solve on your own
D. This is a C++ forum, you're asking for a VB program
Read the sticky threads at the beginning of the forums, and chose the correct forum for your problem. You might then get some help.
vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228