Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me write a flowchart please Downloads/EE%202450%20Program 1 %20(4) pdf Program 1: Write the money collection interface for the vending machine. Your program should tell

Help me write a flowchart please image text in transcribed
Downloads/EE%202450%20Program 1 %20(4) pdf Program 1: Write the money collection interface for the vending machine. Your program should tell the user the price of the item and then the user will enter the amount of money that they are paying (this simulates them actually inserting cash). If the money collected is less than the price, print an appropriate message (such as: "Insufficient funds, no sale!") and then the program should exit. If enough money is collected determine the amount to return to the customer. If the change due is not zero, tell the user how much change they will receive. Next print a message (such as "Thank you~ enjoy your drink!") and end the program normally (at the return 0 statement). Note, your program should be able to handle all amounts of money (not just multiples of dollars but also cents such as $1.25). Also you may assume that the user is only entering a number and not the $ (though the $ coul be part of your prompt). Hint: Check how to do floating point comparisons Program 2. Write a program to determine the drink size based on the letter the user enters. Print a message to the user giving the various drink size options and then prompt the user for the drink size. The user can enter 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, for a medium is 2, and for a Jarge 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)

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

Recommended Textbook for

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions

Question

List the characteristics of an effective HR strategy.

Answered: 1 week ago

Question

1. How do most insects respire ?

Answered: 1 week ago