Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help write a flowchart an 's' or 'S' for small, an 'm' or 'M for medium, and an 'T or 'L' for large. Depending

Please help write a flowchart image text in transcribed
an 's' or 'S' for small, an 'm' or 'M for medium, and an 'T or 'L' for large. Depending on which size the user requests, print a message such as: "You have ordered a (small, medium, large) drink." In addition to displaying the size ordered, also record a price multiplier. The price multiplier for a small is 1, fora medium is 2, and for a large is 3. If the user does not enter a valid character, print an error message (such as "Error: Invalid drink size") and exit the program. You should use nested if-then-else statements for this problem. After the nested if-then-else statements, print the value of the price multiplier to ensure that the correct value was recorded (the price multiplier will be used in program 4). Hint: use the logical OR expression in your comparisons. Program 3. Write a program that displays the various drinks your vending machine offers along with the option number for each drink. Beside each option include the price (you can set the cost for the small, the costs for medium should be 2 times the cost of the small and the cost of the large should be 3 times the cost of the small). For example: "1. Tropical Iced Tea (Small $O.75, Medium $1.50, Large $2:25)" Then prompt the user for their drink selection and enter their selection. Record the cost of the small drink into a variable that will be used to compute the amount due (to be used in program 4). Display a message such as "You selected Tropical Iced Tea". If the user does not enter a valid option, print an error message and exit the program. You should use a switch statement for this problem. To check that you have recorded the amount due properly, after the switch statement, display the amount due for the small size of the drink selected. You must offer at least 4 drink options. 2

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Internal change forces result from changes in:

Answered: 1 week ago

Question

3. How frequently do the assessments occur?

Answered: 1 week ago