Question: I need help with problem 8. It's C programming. Write a program that will simulate a soft drink machine that dispenses four types of soft

 I need help with problem 8. It's C programming. Write a

I need help with problem 8. It's C programming.

Write a program that will simulate a soft drink machine that dispenses four types of soft drinks. The program will accept character input only. The symbols 'C' 'O', 'L', and 'S' will stand for the drinks (Cola, Orange, Lemon, and Spritzer). The symbols 'N', 'D', and 'Q' will stand for the coins nickel, dime, and quarter). No other coins will be accepted. The character 'R' when read as input will stand for the coin return. Any time that 'R' is input, all money should be returned to the user. The program will output messages that simulate the output from the soft drink machine. For example, "cola dispensed, " "30 cents returned", "Sorry, out of Spritzer, " or " Your change is 10 cents." In addition to accepting input of the money and drink selections, and displaying messages to the user, the program will internally keep track of the amount of change, and the inventory each drink. A sample run follows. Enter 65 cents for a drink > Q 25 cents received > D 35 cents received > D 45 cents received > D 70 cents received Make your drink selection now > o Orange drink dispensed 5 cents in change given Enter 65 cents for a drink > Q 25 cents received >Q 50 cents received > C Sorry, insufficient funds entered Please enter additional 15 cents > R 50 cents returned Enter 65 cents for a drink > Write your program in a modular structured style with the different modules in separate source files. Plan the communication between the different parts of the program. Minimize your use of global variables

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!