This will be a menu-driven program. The menu should look like this: Menu ==== 1. Addition of non-negative numbers 2. Alphabetize strings 3. Exit Enter your choice: If the user chooses #1 in the menu, your program should ask the user for 2 integers, then print them and their total. Keep doing this entire process until at least one of the numbers is negative. At that point, the program should print a message that at least one of the numbers is negative. Ex: if the user enters 13 and 2, the output would look like: You entered 13 and 2 Neither is negative Their total is 15 (and the loop should execute again) Ex: if the user enters 100 and -7, the output would look like: You entered 100 and -7 At least one is negative (notice no total is printed and the loop should NOT execute again) If the user chooses #2 in the menu, your program should ask the user for 2 lowercase strings (assume the user will enter lowercase strings) and tell which would come first alphabetically in the form shown in the examples. Keep doing this entire process until one of the strings is "stop". Ex: if the user enters "help" and “hello", the output would look like: 'hello' comes before 'help' alphabetically (and the loop should execute again) Ex: if the user enters "abcdefg" and "abcdefh", the output would look like: 'abcdefg' comes before 'abcdefh' alphabetically (and the loop should execute again) Ex: if the user enters "aaaaa" and "stop", the output would look like: Program is over (notice no comparison is printed and the loop should NOT execute again)
This will be a menu-driven program. The menu should look like this: Menu ==== 1. Addition of non-negative numbers 2. Alphabetize strings 3. Exit Enter your choice: If the user chooses #1 in the menu, your program should ask the user for 2 integers, then print them and their total. Keep doing this entire process until at least one of the numbers is negative. At that point, the program should print a message that at least one of the numbers is negative. Ex: if the user enters 13 and 2, the output would look like: You entered 13 and 2 Neither is negative Their total is 15 (and the loop should execute again) Ex: if the user enters 100 and -7, the output would look like: You entered 100 and -7 At least one is negative (notice no total is printed and the loop should NOT execute again) If the user chooses #2 in the menu, your program should ask the user for 2 lowercase strings (assume the user will enter lowercase strings) and tell which would come first alphabetically in the form shown in the examples. Keep doing this entire process until one of the strings is "stop". Ex: if the user enters "help" and “hello", the output would look like: 'hello' comes before 'help' alphabetically (and the loop should execute again) Ex: if the user enters "abcdefg" and "abcdefh", the output would look like: 'abcdefg' comes before 'abcdefh' alphabetically (and the loop should execute again) Ex: if the user enters "aaaaa" and "stop", the output would look like: Program is over (notice no comparison is printed and the loop should NOT execute again)
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 14E
Related questions
Question
Hi, I need to solve this problem with C++
![This will be a menu-driven program. The menu should look like this:
Menu
====
1. Addition of non-negative numbers
2. Alphabetize strings
3. Exit
Enter your choice:
If the user chooses #1 in the menu, your program should ask the user for 2 integers, then print them and
their total. Keep doing this entire process until at least one of the numbers is negative. At that point, the
program should print a message that at least one of the numbers is negative.
Ex: if the user enters 13 and 2, the output would look like:
You entered 13 and 2
Neither is negative
Their total is 15
(and the loop should execute again)
Ex: if the user enters 100 and -7, the output would look like:
You entered 100 and -7
At least one is negative
(notice no total is printed and the loop should NOT execute again)
If the user chooses #2 in the menu, your program should ask the user for 2 lowercase strings (assume
the user will enter lowercase strings) and tell which would come first alphabetically in
the form shown in the examples. Keep doing this entire process until one of the strings is "stop".
Ex: if the user enters “help" and “hello", the output would look like:
'hello'
comes before 'help' alphabetically
(and the loop should execute again)
Ex: if the user enters "abcdefg" and "abcdefh", the output would look like:
'abcdefg' comes before 'abcdefh' alphabetically
(and the loop should execute again)
Ex: if the user enters "aaaaa" and "stop", the output would look like:
Program is over
(notice no comparison is printed and the loop should NOT execute again)
Your program should continue to print the menu, get the user's choice, and print the results until the user
enters #3 on the menu, at which time your program should print a short message telling the user the
program is over, and the program ends.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fd215dd44-e508-40ce-bf0f-a2e1b0bb3ee5%2F687b99f9-5fc3-4b60-ab5b-2cbc0df4bdf9%2Flap29zr_processed.png&w=3840&q=75)
Transcribed Image Text:This will be a menu-driven program. The menu should look like this:
Menu
====
1. Addition of non-negative numbers
2. Alphabetize strings
3. Exit
Enter your choice:
If the user chooses #1 in the menu, your program should ask the user for 2 integers, then print them and
their total. Keep doing this entire process until at least one of the numbers is negative. At that point, the
program should print a message that at least one of the numbers is negative.
Ex: if the user enters 13 and 2, the output would look like:
You entered 13 and 2
Neither is negative
Their total is 15
(and the loop should execute again)
Ex: if the user enters 100 and -7, the output would look like:
You entered 100 and -7
At least one is negative
(notice no total is printed and the loop should NOT execute again)
If the user chooses #2 in the menu, your program should ask the user for 2 lowercase strings (assume
the user will enter lowercase strings) and tell which would come first alphabetically in
the form shown in the examples. Keep doing this entire process until one of the strings is "stop".
Ex: if the user enters “help" and “hello", the output would look like:
'hello'
comes before 'help' alphabetically
(and the loop should execute again)
Ex: if the user enters "abcdefg" and "abcdefh", the output would look like:
'abcdefg' comes before 'abcdefh' alphabetically
(and the loop should execute again)
Ex: if the user enters "aaaaa" and "stop", the output would look like:
Program is over
(notice no comparison is printed and the loop should NOT execute again)
Your program should continue to print the menu, get the user's choice, and print the results until the user
enters #3 on the menu, at which time your program should print a short message telling the user the
program is over, and the program ends.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning