Menu Help!
Hi there i need help with making a menu for a guess game, could you help me please thanks!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
#include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main()
{
int choice;
start:
cout <<"Choose Option";
cin>>choice;
//option 1
if (choice ==1)
{
int a, b;
system ("cls");
cout << "OPTION 1/n/n/n";
}
_getch();
}
//Option 2
if ( choice ==2 )
{
cout << "OPTION 2";
{
_getch();
}
//Choice 3 of application
if (choice==3)
{
cout << "OPTION 3";
}
_getch();
}
}
}
//OPTION 4
if (choice == 4)
{
;
cout << "OPTION 4";
//OPTION 5
if (choice == 5)
{
;
cout << "OPTION 5\n";
//SELECTION ERROR
if ((choice > 5) || (choice < 1))
{
system("cls");
cout << "\n\nERROR. PLEASE SELECT 1 - 5 ONLY.";
cout << "\n\n\n\nPress a key to return to selection menu...";
_getch();
goto start;
}
}
|
What is the problem? Does not not compile/run/run as expected?
yeahh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
#include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main()
{
int choice;
start:
cout <<"Choose Option ";
cin>>choice;
//option 1
if (choice ==1)
// {
//int a, b;
// system ("cls");
cout << "OPTION 1"<<endl;// /n/n/n";
// }
//getch();
// }
//Option 2
if ( choice ==2 )
//{
cout << "OPTION 2"<<endl;
// {
// _getch();
//}
//Choice 3 of application
if (choice==3)
//{
cout << "OPTION 3"<<endl;
//}
// _getch();
//}
// }
//}
//OPTION 4
if (choice == 4)
//{
//;
cout << "OPTION 4"<<endl;
//OPTION 5
if (choice == 5)
// {
//;
cout << "OPTION 5\n";
//SELECTION ERROR
if ((choice > 5) || (choice < 1))
{
// system("cls");
cout << "\n\nERROR. PLEASE SELECT 1 - 5 ONLY.";
cout << "\n\n\n\nPress a key to return to selection menu...";
_getch();
goto start;
}
}
|
Last edited on
Topic archived. No new replies allowed.