answersLogoWhite

0


Best Answer

#include<iostream>

#include<conio.h> // for _getch()

void action1_1_1() { std::cout << "Performing action 1.1.1\n\n"; }

void action1_1_2() { std::cout << "Performing action 1.1.2\n\n"; }

void action1_1_3() { std::cout << "Performing action 1.1.3\n\n"; }

void action1_2_1() { std::cout << "Performing action 1.2.1\n\n"; }

void action1_2_2() { std::cout << "Performing action 1.2.2\n\n"; }

void action1_2_3() { std::cout << "Performing action 1.2.3\n\n"; }

void action1_3_1() { std::cout << "Performing action 1.3.1\n\n"; }

void action1_3_2() { std::cout << "Performing action 1.3.2\n\n"; }

void action1_3_3() { std::cout << "Performing action 1.3.3\n\n"; }

void action2_1_1() { std::cout << "Performing action 2.1.1\n\n"; }

void action2_1_2() { std::cout << "Performing action 2.1.2\n\n"; }

void action2_1_3() { std::cout << "Performing action 2.1.3\n\n"; }

void action2_2_1() { std::cout << "Performing action 2.2.1\n\n"; }

void action2_2_2() { std::cout << "Performing action 2.2.2\n\n"; }

void action2_2_3() { std::cout << "Performing action 2.2.3\n\n"; }

void action2_3_1() { std::cout << "Performing action 2.3.1\n\n"; }

void action2_3_2() { std::cout << "Performing action 2.3.2\n\n"; }

void action2_3_3() { std::cout << "Performing action 2.3.3\n\n"; }

void action3_1_1() { std::cout << "Performing action 3.1.1\n\n"; }

void action3_1_2() { std::cout << "Performing action 3.1.2\n\n"; }

void action3_1_3() { std::cout << "Performing action 3.1.3\n\n"; }

void action3_2_1() { std::cout << "Performing action 3.2.1\n\n"; }

void action3_2_2() { std::cout << "Performing action 3.2.2\n\n"; }

void action3_2_3() { std::cout << "Performing action 3.2.3\n\n"; }

void action3_3_1() { std::cout << "Performing action 3.3.1\n\n"; }

void action3_3_2() { std::cout << "Performing action 3.3.2\n\n"; }

void action3_3_3() { std::cout << "Performing action 3.3.3\n\n"; }

void submenu1_1()

{

while (true)

{

std::cout

<< "SUBMENU 1.1\n===========\n\n"

<< "1 - action 1.1.1\n"

<< "2 - action 1.1.2\n"

<< "3 - action 1.1.3\n"

<< "X - exit to submenu 1\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action1_1_1(); break;

case '2': action1_1_2(); break;

case '3': action1_1_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu1_2()

{

while (true)

{

std::cout

<< "SUBMENU 1.2\n===========\n\n"

<< "1 - action 1.2.1\n"

<< "2 - action 1.2.2\n"

<< "3 - action 1.2.3\n"

<< "X - exit to submenu 1\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action1_2_1(); break;

case '2': action1_2_2(); break;

case '3': action1_2_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu1_3()

{

while (true)

{

std::cout

<< "SUBMENU 1.3\n===========\n\n"

<< "1 - action 1.3.1\n"

<< "2 - action 1.3.2\n"

<< "3 - action 1.3.3\n"

<< "X - exit to submenu 1\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action1_3_1(); break;

case '2': action1_3_2(); break;

case '3': action1_3_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu2_1()

{

while (true)

{

std::cout

<< "SUBMENU 2.1\n===========\n\n"

<< "1 - action 2.1.1\n"

<< "2 - action 2.1.2\n"

<< "3 - action 2.1.3\n"

<< "X - exit to submenu 2\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action2_1_1(); break;

case '2': action2_1_2(); break;

case '3': action2_1_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu2_2()

{

while (true)

{

std::cout

<< "SUBMENU 2.2\n===========\n\n"

<< "1 - action 2.2.1\n"

<< "2 - action 2.2.2\n"

<< "3 - action 2.2.3\n"

<< "X - exit to submenu 2\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action2_2_1(); break;

case '2': action2_2_2(); break;

case '3': action2_2_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu2_3()

{

while (true)

{

std::cout

<< "SUBMENU 2.3\n===========\n\n"

<< "1 - action 2.3.1\n"

<< "2 - action 2.3.2\n"

<< "3 - action 2.3.3\n"

<< "X - exit to submenu 2\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action2_3_1(); break;

case '2': action2_3_2(); break;

case '3': action2_3_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu3_1()

{

while (true)

{

std::cout

<< "SUBMENU 3.1\n===========\n\n"

<< "1 - action 3.1.1\n"

<< "2 - action 3.1.2\n"

<< "3 - action 3.1.3\n"

<< "X - exit to submenu 3\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action3_1_1(); break;

case '2': action3_1_2(); break;

case '3': action3_1_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu3_2()

{

while (true)

{

std::cout

<< "SUBMENU 3.2\n===========\n\n"

<< "1 - action 3.2.1\n"

<< "2 - action 3.2.2\n"

<< "3 - action 3.2.3\n"

<< "X - exit to submenu 3\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action3_2_1(); break;

case '2': action3_2_2(); break;

case '3': action3_2_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu3_3()

{

while (true)

{

std::cout

<< "SUBMENU 3.3\n===========\n\n"

<< "1 - action 3.3.1\n"

<< "2 - action 3.3.2\n"

<< "3 - action 3.3.3\n"

<< "X - exit to submenu 3\n\n";

int i = _getch();

switch ((char) i)

{

case '1': action3_3_1(); break;

case '2': action3_3_2(); break;

case '3': action3_3_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu1()

{

while (true)

{

std::cout

<< "SUBMENU 1\n=========\n\n"

<< "1 - sub-menu 1.1\n"

<< "2 - sub-menu 1.2\n"

<< "3 - sub-menu 1.3\n"

<< "X - exit to main menu\n\n";

int i = _getch();

switch ((char) i)

{

case '1': submenu1_1(); break;

case '2': submenu1_2(); break;

case '3': submenu1_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu2()

{

while (true)

{

std::cout

<< "SUBMENU 2\n=========\n\n"

<< "1 - sub-menu 2.1\n"

<< "2 - sub-menu 2.2\n"

<< "3 - sub-menu 2.3\n"

<< "X - exit to main menu\n\n";

int i = _getch();

switch ((char) i)

{

case '1': submenu2_1(); break;

case '2': submenu2_2(); break;

case '3': submenu2_3(); break;

case 'X':

case 'x': return;

}

}

}

void submenu3()

{

while (true)

{

std::cout

<< "SUBMENU 3\n=========\n\n"

<< "1 - sub-menu 3.1\n"

<< "2 - sub-menu 3.2\n"

<< "3 - sub-menu 3.3\n"

<< "X - exit to main menu\n\n";

int i = _getch();

switch ((char) i)

{

case '1': submenu3_1(); break;

case '2': submenu3_2(); break;

case '3': submenu3_3(); break;

case 'X':

case 'x': return;

}

}

}

int main()

{

while (true)

{

std::cout

<< "MAIN MENU\n=========\n\n"

<< "1 - sub-menu 1\n"

<< "2 - sub-menu 2\n"

<< "3 - sub-menu 3\n"

<< "X - exit program\n\n";

int i = _getch();

switch ((char) i)

{

case '1': submenu1(); break;

case '2': submenu2(); break;

case '3': submenu3(); break;

case 'X':

case 'x': return 0;

}

}

}

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you create menu in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you write classes and objects for hospital management software using objective c or c plus plus?

You declare a class as follows: class MyClass { //some stuff here... } You create an object as follows: MyClass object; This is how you create classes and objects in C++.


What prototype for menu function takes no arguments but returns a char value?

char SomeFunction();This has nothing to do with menu functions. It is a straight C/C++ answer. Menu functions depend on the platform API, not on C/C++.


What is a makefile project in c plus plus?

You use a makefile project when you have a project that you normally build from the command line. Your IDE will not recognise this project so you must create a makefile project for it. In Visual C++, for instance, you can use the Makefile Project Wizard to create a Makefile Project.


What is a source code file in c plus plus?

A source code file is a plain-text file containing C++ instructions. The instructions must be compiled and linked to create a native machine code executable.


Is C plus plus same as Microsoft Visual C plus plus Express Edition?

Your question request a comparison between apples and pears. C++ is a programming language. Microsoft Visual C++ Express is one of many development tools that you can use to create programs using the C++ programming language. Microsoft Visual C++ Express supports native C++ development, and supports development in 'managed C++,' a Microsoft-specific derivative of the C++ language, aimed specifically at the .NET platform.

Related questions

How do you create .exe file in c plus plus?

You can create an exe-file from your C++ source, if you have a compiler.


How do you create folder with c plus plus?

Use function mkdir.


How do you create a class in C plus plus?

class class_name { private: data_members; public: member_functions; };


Which one easier C plus plus or assembly language?

C++, but it's always worth learning both, if only to better understand the machine code you create with C++.


How do you write classes and objects for hospital management software using objective c or c plus plus?

You declare a class as follows: class MyClass { //some stuff here... } You create an object as follows: MyClass object; This is how you create classes and objects in C++.


How to create a thread in C plus plus?

Not part of the language, platform-dependent. Windows: CreateThread Posix: pthread_create in pthread.h


What property would you set on a menu item in order to have the user activate that option by hitting Ctrl plus C?

hotkey


Who to create a healthy menu?

if you want somebody to create a helthy menu, talk to a vegitarian! Peace out, Cupcakeluver.


In excell can I create a dropdown menu within a dropdown menu?

no


How do you create a game library for a c plus plus compiler used for 3D sonic the hedgehog games?

You would have to use coding.


Choose three integers a b and c Now use a b and c to create a trinomial ax2 plus bx plus c Can you factor this trinomial How would you create a trinomial that will factor?

1, 5 and 6 x^2 + 5x + 6 = (x + 2)(x + 3)


What are the combinations such as alt plus f4 and ctrl plus c called?

They are called accelerators. They are shortcut keystrokes that bypass the command menu system and call the associated command directly.