#include <iostream>
using namespace std;
int main()
{
//delcare varialbe
char selection;
//declare function
void counting_loop();
void impossible();
void missing_item();
void odd_even();
void poem();
void pause_m(void);
do
{
cout << " Welcome to the Fun Program" << endl;
cout << " Select from the menu " << endl ;
cout << "A gets Counting loop. " << endl;
cout << "B gets Impossible."<< endl;
cout << "C gets Missing Item."<< endl;
cout << "D gets Odd or Even." << endl ;
cout << "E gets Poem." << endl;
cout << " Enter the letter of your choice. " << endl;
cout << " Then hit the enter key. " << endl;
cout << " Your choice : --> " ;
cin >> selection ;
// switch command
switch (selection)
{
case 'a':
case 'A': counting_loop(); // call function
break;
case 'b':
case 'B': impossible();// call function
break;
case 'c':
case 'C': missing_item();
break;
case 'd':
case 'D' : odd_even();
break;
case 'e':
case 'E': poem();
}// end switch
} while (selection!='Q'&&selection!='q');
}
// function definition
//couting_loop
void counting_loop()
{
for (int x=0 ; x< 5; x++)
{
cout << "Are we having fun ?" << endl ;
pause_m();
}
}// end for
// call function pause
//---------------------------------------------//
//fucntion pause
void pause_m(void)
{
cout << "\n\n";
system("PAUSE");
cout << "\n\n";
return;
}
//------------------------------------------//
//clear function
void clear_m(void)
{
system("CLS");
return;
}
//---------------------------------------//
void impossible()
{
cout << " The repeat until loop is impossible in C++." << endl;
pause_m();
}
void missing_item()
{
cout << "This program is missing only the while loop." << endl ;
pause_m();
}
void odd_even()
{
int userinput;
cout << " Enter an integer : " << endl;
cin >> userinput;
if ( userinput % 2 = 0)
{
cout << " Your number was odd. " << endl ;
}
else
{
cout << " Your number was even. " << endl ;
}
pause_m();
}
void poem()
{
cout <<"Feelings that once were hidden" <<endl;
cout <<"Are now expressed to you." << endl;
cout <<"Days that once were stormy" << endl;
cout <<"Are now the brightest blue." << endl;
pause_m();
}
it kept saying that the fucntion pause is undeclare ? dont' know why ? anyhelps are appirciated