Question: Write a C++ program that asks the user the questions from the Deciding what to have for lunch? flow chart and displays the appropriate message

 Write a C++ program that asks the user the questions from

Write a C++ program that asks the user the questions from the Deciding what to have for lunch? flow chart and displays the appropriate message to the user.

  1. The user should be prompted to ask the first questions in the diamond on the flow chart and asked to respond with

a Y or y for Yes and

a N or n for No

or

a A or a for A lot and

a B or b for Not much

(depending upon the question).

    • If the user enters a valid option the corresponding path on the flow chart is followed.
    • Otherwise, the user is told that they entered invalid data and asked to run the program again
  1. Once you reach the end of the path on the flow chart (a yellow rectangle), the message at the end is displayed to the user and the program ends.

Deciding what to have for lunch How much time do I have? A lot A Do I have bread? Yes Not much No Make a Sandwich Better throw something in the microwave Yes Do I have lettuce? No Make a salad! Better go to the store

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!