Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question is using C++ Software. Write codes that will produce the screen as shown Firstly, the program prompts user to enter his name. Then

This question is using C++ Software.

image text in transcribed

Write codes that will produce the screen as shown Firstly, the program prompts user to enter his name. Then it will display Hello . Next it prints out a menu which contains 5 options (1- add two integers, 2- add two strings, 3- compute factorial, 4- reverse a string, 5- quit program). Code all 5 tasks appropriately. When the task is completed (not including quitting program of course), the menu pops up again and asks user to try on another task. This repeats until q' or Q' is pressed. You may use switch-case" or if-else", but the former looks more legible Even though you may know how to write functions, do not use functions in this program. Hints Task 1 - Simple cin, and cout. Task 2 - Use strcpx (check lecture notes Chpt 1.2.7.1) Task 3 - Use a loop (while or for) Task 4 - This is pretty hard. Use a while loop but needs some thinking Repeating menu: Use gato-label statements, or an appropriate loop Enter nane please >Peter Enter positive integer n >5 ello Peter Please select one = 120 Please select one: '1Add two integers '2 Add two strings 3'Compute factorial of an integer (n 4Reverse a string 'Q' - Quit program 5555- MENU 1Add two integers ,2' - Add two strings '3'-Conpute factorial of an integer (n? > 4Reverse a string 'Q' - Quit program >1 >4 Enter two integers -3 52 Enter string to be reversed max 18 chars> >meatball Reversed string ilabtaen Please select one: Please select one 55525 MENU5 1Add two integers 2'Add two strings '3' - Compute factorial of an integer n!> 4Reverse a string ,Q' - Quit program 5555- MENU 1Add two integers ,2, -Add two strings 3'- Conpute factorial of an integer >>Michael Jordar The result is MichaelJordan Progran quitting.. . Please select one: Press anu key to continue 252 MENU2 1Add two integers 2-Add two strings ,3, -Compute factorial of an integer n!) Reverse a string ,Q' - Quit program<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions