MCPcopy Create free account
hub / github.com/Rustam-Z/cpp-programming / main_menu_view

Function main_menu_view

Project_Quiz_Game/quiz-game.cpp:14–70  ·  view source on GitHub ↗

the main menu view and some additionl functionalities

Source from the content-addressed store, hash-verified

12
13//the main menu view and some additionl functionalities
14int main_menu_view()
15{
16 system("color 3F");
17 cout << "\t\t *************************************************************************************" << endl;
18 cout << "\t\t ***** *****" << endl;
19 cout << "\t\t ***** H E L L O ! W E L C O M E T O T H E 'Q U I Z L E T' *****" << endl;
20 cout << "\t\t ***** = = = = = = = = = = = = = = = = = = = = = = = = *****" << endl;
21 cout << "\t\t ***** = = = = = = = = = = = = *****" << endl;
22 cout << "\t\t ***** B Y *****" << endl;
23 cout << "\t\t ***** R U S T A M Z O K I R O V *****" << endl;
24 cout << "\t\t ***** *****" << endl;
25 cout << "\t\t *************************************************************************************" << endl;
26 cout << endl;
27
28 cout << "\t\t\t\t\t\tH O W T O P L A Y\n\n";
29 cout << "\t\t1. IN THIS QUIZ GAME YOU WILL BE GIVEN 10 'C++ PROGRAMMING LANGUAGE' RELATED QUESTIONS.\n\n";
30 cout << "\t\t2. IF YOU PRESS INCORRECT KEY, THE PROGRAM WILL AGAIN ASK YOU TO INPUT CORRECT VALUE.\n\n";
31 cout << "\t\t3. ADDITIONALLY YOU WILL HAVE SOME HINTS WHICH YOU CAN USE FROM the 8TH QUESTION.\n\n";
32 cout << "\t\t4. YOU WILL LOSE '5' POINTS FROM YOUR OVERALL SCORE IF YOU WILL USE HINTS.\n\n\n\n";
33 cout << "\t\t\t\t\tPRESS THE 'ENTER' KEY TO START A QUIZ... ";
34 if (cin.get() == '\n') {
35 system("cls");
36 cout << "\t\t\t\t\tI N F O R M A T I O N T A B L E\n\n";
37 cout << "What is your name? ";
38 getline(cin, Name[0]);
39 cout << "What is your level of C++?"<<endl;
40 cout << "[1]. Junior" << endl;
41 cout << "[2]. Middle" << endl;
42 cout << "[3]. Senior" << endl;
43 do {
44 cout << "Choose the level of difficulty: ";
45 cin >> level;
46 cin.clear();
47 } while (level != "1"&&level!="2"&&level!="3");
48 string Respond;
49 cout << endl;
50 cout << "Are you ready to take the Quiz " << Name[0] << " ? Yes = 'Yes'/No = 'Any key'. " << endl;
51 cout << "Your choice: ";
52 cin >> Respond;
53 if (Respond == "yes" || Respond == "Yes")
54 {
55 cout << endl;
56 cout << "OK, Good Like!!! " << endl;
57 system("cls");
58 return 1;
59 }
60 else
61 {
62 cout << "OK. Goodbye." << endl;
63 system("exit");
64 return 0;
65 }
66 }
67 else
68 cout << "I meant ONLY the ENTER key... Oh well.\n";
69 return 0;
70}
71//the view for the hints in the corner

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected