Question
Please help and I will rate!
There are two (2) configuration files for the vending machine. You will have to make each of these first. Your vending machine should read each configuration in. You will use arrays to store the data, and work with it. One contains information about the machine, the other about the products. The user will deposit money first and then order a product. They should not be able to order a product more expensive than their money already deposited. They may add more money when they wish and get their change (unused money) when they want. As the machine sells products, the inventory for those products is adjusted. If the inventory of a particular product goes below its low-inventory threshold, that product should have a low-inventory note next to it in the menu. If it is sold out, it is not shown on the menu. As the machine operates, it keeps a log (in a file) of what is happening. Configuration File Formats Here is the format for the machine configuration file: Line # information on this line The name of the vending machine The vending machine ID # The vending company which owns the machine Advertising message to be displayed after vending a product Goodbye message to be displayed after returning unused deposited money Here is a description of the product configuration file. Each line will look like this: 17:####: Snickers: 0.75:5 Where: There will be up at most 20 products. Keep reading them until there aren't any more. What goes in the logfile? Write a line at the end of the logfile for every action: deposit of money, dispensing of a product, change given, product low-inventory warnings. For example, this line should include the vending machine id, the product id and any other relevant details. Some hints: Don't write the whole program all at once. Write individual functions and test them in separate driver programs. This is especially true for the reading and writing of files, which occurs at several points in this assignment. Y'ou must use the best practices we've been learning. That means enhancing maintainability with appropriate use of constants, proper procedural abstraction and documentation.
Explanation / Answer
#include #include using namespace std; int main() { char money; double totalm = 0; double value = 0, valued = 0, valuen = 0, valueq = 0, valueb = 0; int c1=0, c2=0, c3=0, c4=0, c5=0, c6=0; int C1=0, C2=0, C3=0, C4=0, C5=0, C6=0; int item; cout