I came upon this website while trying to search for a solution to my school mini-project. I'm into Electronics Engineering (Diploma) and is tested on C/C++. I've actually writen part of the programs, however, some issues are unable to be solved by me and my group mates. From here, I'd like to call upon you guys to help me pass this module..! :D

--------
Question:A Software Model of a Snack Vending Machine

Description
A snack vending machine sells biscuits and potato chips. A packet of biscuits cost 40cents, while a packet of potato chips costs 70cents. The machine will track the amount of money inserted into the coin slot and dispenses a packet of biscuit/potato chips when at least the correct amount of money (40c or 70c) has been inserted. Only 10c, 20c and 50c can be accepted and only 10c and 20c can be returned to the customer.

To purchase a packet of biscuits at the vending machine a customer has to press 'biscuit'/'potato chips' andinsert any combinations of 10c, 20c and 50c coins. If transaction is successful, the machine will dispense a packet of the requested snack and return the change(if any).

For example, a customer wants to purchase a packet of biscuits using 2 20c coins. Total amount paid is 40c. Machine willdispense the biscuit with no change.

ANother example, a customer wants to purchase a packet of potato chips, he inserted 4x20c. Total money inserted is 80c. the vending machine will dispense a packet of potato chips and return a change of 10c.

System Specs
Input:
To simulate the operations of the vending machine, all inputs and typed as strings of characters. Vending machine will only accept text strings as input.

To simulate the pressing of the biscuit or potato chips button, customer have to type therespective word into the program. Input can be typed with either Upper-case or Lower-case, or even mixed-case.

Correct form of spelling will be accepted by system as a valid request and all other input will be rejected by the vending machine.

Similarly, to simulate the insertion of a coin, the customer has to type a string of characters representing the denomination of coin. For eg, 'ten' would be typed to representing an insertion of 10c coin and fifty would be for 50c. Also, can of of Upper/Lower/Mixed cases.

Correct form of spelling will be accepted by system as a valid request and all other input will be rejected by the vending machine.

Processing
When program is first run, the system must be initialised withthe following:
1) number of packets of biscuits and potato chips stored inside the vending machine
2) number of 10c and 20c that have been put inside the voin storage, which are ready for change.

During transaction,
System will promt user to state his request, Biscuit/Potato chips, then system will promt user to insert coins andtrack the amount of coins inserted. When correct amount of coin is inserted, thesystem will disable the coin input.

System will calculate change required and determine the combination of 10c and 20c change to be return to customer.

When processing, system must also check for the availaibility of the respective snacks, and also the the amount of coins to be returned to customer as change. APropriate actions shd be taken in the event if there is no more stocks or coins in return. If transaction is sucessful, the system must indicate that a packet of the requested snack is dispensed and the combination of coins returned as change. The system must then allow thenext customer to make a purchase.

If transaction is unseuccessful, reason being that here is no more stock of snacks. System must inform customer of the situation and provide an option to quit. If transaction is unsuccessful becuase of insufficient amount of coins to be returned as change, system will advise customer to use the correct amount of coins, and allow him another chance to continue with the purchase of the snack. Alternatively, user can actually choose to discontinue with the purchase and system must refund the coins inserted intot he machine.

The machine must open the following text files to record the system operation:

1) customer input file, that records every customer input which is stored as a structure containing the type of snack, the combination of coins inserted, the total amount of money paid by customer.
2) a transaction file that contains a nested structure containing the above structure asa member, the amount of change to be returned to customer and the combination of coins that is return to the customer as change.

When shut-down for maintenance.
When machine is to be shut down for maintenance, program will quit. B4 quitting, the system must record the following information as the last line in theabove transaction file:

- number of packets of each type of snack sold.
- number of packets of each type of snack left.
- total amount of money present in the machine.

Output
Program must have all output date/fils stipulated in the System Specs, and may include any other output data/files which are necessary for the system to operate succesfully and is user-friendly.

--------

Hmm, I apologise for thelong question above. Becuase I have to type outthe whole question in order tolet you guys understand my project. :D

Currently, I actually is able to run the program ONCE only. But with alot of the other parts here and there not ready. I'm not able to let another new customer to come and make another purchase. With these, I really need you guys to help me.. Meanwhile, i'll be searching in the net for some solutions.. Thanks Guys.. Thanks.. :cool:

09-07-2005

beanroaster

Well, what do you have so far? And what part of it do you need help on?
Good luck,

09-07-2005

curlious

KMA
Anyhow this is just like homework except you people are probably in a business.
The idea is you post the code you have worked on and we help, not we write the code for you givin the specs.

KMA = Kiss My Ass

09-07-2005

beanroaster

A bit harsh, but we do need the code you already made.
Good luck,

09-08-2005

Salem

Read the rules about homework.
This thread closed.

When you've done more work than select all, copy, paste then feel free to post another thread asking specific questions.