Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 61 additions & 43 deletions Lab_19/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,50 +222,68 @@ void F_Third_Program()
} // for loop
}

int main()
{
for (int k = 0; k < 1000; k++)
{
system("cls");
cout << "M A I N M E N U\n"
<< "-------------------\n"
<< "1. First Program\n"
<< "2. Second Program\n"
<< "3. Third Program\n"
<< "Your choice: \n";

switch (_getch())
{
case 49:
system("cls");
F_First_Program();
system("pause");
break;

case 50:
system("cls");
F_Second_Program();
system("pause");
break;

case 51:
system("cls");
F_Third_Program();
system("pause");
break;

case 48:
return 0;
break;
#include <iostream>
#include <conio.h>
using namespace std;

default:
cout << "Your choice is not available in Menu.\nPlease try one more time\n";
system("pause");
break;
void clearScreen() {
// Platform-independent screen clear
#ifdef _WIN32
system("cls");
#else
system("clear");
#endif
}

} // switch
} // for loop
void pauseExecution() {
cout << "Press any key to continue...";
_getch();
}

system("pause");
return 0;
int main()
{
for (int k = 0; k < 1000; k++)
{
clearScreen();
cout << "M A I N M E N U\n"
<< "-------------------\n"
<< "1. First Program\n"
<< "2. Second Program\n"
<< "3. Third Program\n"
<< "Your choice: \n";

switch (_getch())
{
case 49:
clearScreen();
F_First_Program();
pauseExecution();
break;

case 50:
clearScreen();
F_Second_Program();
pauseExecution();
break;

case 51:
clearScreen();
F_Third_Program();
pauseExecution();
break;

case 48:
return 0;
break;

default:
cout << "Your choice is not available in Menu.\nPlease try one more time\n";
pauseExecution();
break;

} // switch
} // for loop

pauseExecution();
return 0;
}