so i'm stuck in creating a do/while menu doing this.
menu option 1 - use the for loop
menu option 2 - use the while loop
menu option 3 - use the do/while loop
in each option, print the numbers from 1 to 10
I made my functions like this. Anyone know how to do this?
the code on the bottom is just a example the teacher show us for do/while
#include <iostream> // needed for cin/count
#include <cmath> // needed for math functions
using namespace std;
/****************************
* prototypes //declared function so main can find
*****************************/
void option01();
int main () // prototype to main
{
char option;
do
{
cout << " WYZ Company \n\n";
cout << " 1 - for loop \n\n";
cout << " 2 - while loop \n\n";
cout << " 3 - do while loop \n\n";
cout << " 4 - stuff01 \n\n";
cout << " 5 - stuff02 \n\n";
cout << " 9 - exit \n\n";
cout << "enter desired processing option here: [ ]\b\b";
cin >> option;
switch(option)
{
case '1': option01();
break;
case '2': cout << "you entered option 2\n";
break;
case '3': cout << "you entered option 3\n";
break;
case '4': cout << "you entered option 4\n";
break;
case '5': cout << "you entered option 5\n";
break;
case '9': cout << "we'er otta here\n";
break;
default: cout << "wrong code dummy\n";
} // end switch
}while(option != '9');
system("pause");
}
void option01()
{
cout << "you entered option 1\n";