Dev C Vending Machine Program Free
Dev C Vending Machine Programram
Can someone with C++ exprience build a very basic vending Machine program that has comments on the important functions and data is taken from a seperate text file.
Below are the requirements basically.
(TEXT FILE)
**************************************
Name Cost Number
Cola $0.75 20
Lemon Lime $0.75 20
Root Beer $0.75 20
Grape Soda $0.80 20
Cream Soda $0.80 20
************************************
Write a program that simulates a soft drink machine. The program should use a struct that stores
the following data:
Drink Name
Drink Cost
Number of Drinks in Machine
The program should create an array of five elements of type struct. The elements should be
initialized with the values from the file “drinkMachine.txt”.
Each time the program runs, it should enter a loop that performs the following steps:
1. A list of drinks is displayed on the screen.
2. The user should be allowed to quit the program or pick a drink.
If the user selects a drink, she will next enter the amount of money that is to be inserted into the
drink machine.
The program should display the amount of change that would be returned and subtract one from
the number of that drink left in the machine. If the user selects a drink that has sold out, a
message should be displayed. The loop then repeats. When the user choses to quit the program it
should display to the screen the total amount of money the machine earned.
Input validation: When the user enters an amount of money, do not accept negative values, or
values greater than $1.00.
*****************************************
Below are the requirements basically.
(TEXT FILE)
**************************************
Name Cost Number
Cola $0.75 20
Lemon Lime $0.75 20
Root Beer $0.75 20
Grape Soda $0.80 20
Cream Soda $0.80 20
************************************
Write a program that simulates a soft drink machine. The program should use a struct that stores
the following data:
Drink Name
Drink Cost
Number of Drinks in Machine
The program should create an array of five elements of type struct. The elements should be
initialized with the values from the file “drinkMachine.txt”.
Each time the program runs, it should enter a loop that performs the following steps:
1. A list of drinks is displayed on the screen.
2. The user should be allowed to quit the program or pick a drink.
If the user selects a drink, she will next enter the amount of money that is to be inserted into the
drink machine.
The program should display the amount of change that would be returned and subtract one from
the number of that drink left in the machine. If the user selects a drink that has sold out, a
message should be displayed. The loop then repeats. When the user choses to quit the program it
should display to the screen the total amount of money the machine earned.
Input validation: When the user enters an amount of money, do not accept negative values, or
values greater than $1.00.
*****************************************
Simple Vending Machine Program. In programming, the most basic form of input/output (I/O) is displaying some text to a user and allowing the user to enter some text back. Or, as Wikipedia puts it: Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading.
Write a c program to simulate a vending machine. Your vending machine will be limited to 5 items only (soda, water, coffee, chocolate, gum). Soda costs $3, water costs $2, coffee costs $5, chocolate costs $4, and gum costs $1.