Question: Create a C++ program that simulates a soda machine and follows the given requirements. Please help! For your second programming project, you are to write

Create a C++ program that simulates a soda machine and follows the given requirements. Please help!  Create a C++ program that simulates a soda machine and follows
the given requirements. Please help! For your second programming project, you are
to write a C program that will simulate a soda machine! The
program is to use a struct that stores the following data members:

For your second programming project, you are to write a C program that will simulate a soda machine! The program is to use a struct that stores the following data members: Soda name Soda cost Number of sodas in machine The original contents of the soda machine are contained in the binary file, "sodas.dat", which I have made available with this assignment. It is a file of five structs, each with the members indicated above. Your program is to read this file and place its contents into the array, soda, of data type SodaType. You should keep a safe copy of "sodas dat" in a separate folder in case that you nccd to usc it again in your project folder should you nced to fix your program and run your program correctly in the final tcst. SodaType soda where SodaType is the struct type, struct SodaType char name[12]; float price; int num; Soda Type must be declared globally. Your program will then process the array, soda, according to the choices made by the user. The original binary file for the soda machine starts with five sodas each. So when the program runs the first time, a description to the user is to be displayed at the screen and then the following menu of selections is to be displayed at the screen Choose from the following Menu: 1) Cola 0.75 2) Root Beer 0.80 3) Ginger Ale 0.95 4) Orange Soda 0.80 5) Grape Soda 0.85 6) Leave the soda machinc Choose one

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!