Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 19 21 2012 Proceedings Part 3 Lnai 7198

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284922, 978-3642284922

More Books

Students also viewed these Databases questions

Question

6. How do you expect to use active listening during the meeting?

Answered: 1 week ago