I have even looked up the goto statement but that will not do what I need the program to do.
So here is the Program / Source code I am working on.
// Menu Chooser
#include <iostream>
using namespace std;
int main()
{
cout << "Difficulty Levels\n\n";
cout << "1 - Easy\n";
cout << "2 - Normal\n";
cout << "3 - Hard\n";
int choice;
cout << "Choice: ";
cin >> choice;
switch (choice)
{
case 0:
cout << "Good Bye!";
system("PAUSE");
break;
case 1:
cout << "You picked Easy.\n";
system("PAUSE");
break;
case 2:
cout << "You picked Normal.\n";
system("PAUSE");
break;
case 3:
cout << "You picked Hard.\n";
system("PAUSE");
break;
default:
cout << "Please choose between Easy, Normal and Hard only.\n";
system("PAUSE");
break;
}
return 0;
}
Alright, Now if you are already a coder you know that this will not loop after pressing either of the options.
What I want to program to do is the following.
Console Display:
Difficulty Levels
0 - Exit
1 - Easy
2 - Normal
3 - Hard
Choice: 1
Press any key to continue...
// program clears screen then loops to the top.
Difficulty Levels
0 - Exit
1 - Easy
2 - Normal
3 - Hard
Choice: |
// At this point of the program it does a system("PAUSE"); then a system("CLS") then loops back at the top. So 1, 2, 3 should display what level difficulty they picked 0 should exit the program. There also needs to be an if statement that says if (choice > 3) display "Please choose between Easy, Normal, and Hard only.


Sign In
Create Account



Back to top









