Thread: School Mini-Project on C/C++ (Need Your Help)..

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    1

    Talking School Mini-Project on C/C++ (Need Your Help)..

    Hi Guys..

    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..!

    --------
    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.

    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..

  2. #2
    Registered User
    Join Date
    Sep 2005
    Location
    USA
    Posts
    69
    Well, what do you have so far? And what part of it do you need help on?
    Good luck,
    Adam

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    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

  4. #4
    Registered User
    Join Date
    Sep 2005
    Location
    USA
    Posts
    69
    A bit harsh, but we do need the code you already made.
    Good luck,
    Adam

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    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.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  2. New Mini Project
    By jverkoey in forum Game Programming
    Replies: 3
    Last Post: 05-12-2004, 11:00 PM
  3. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM
  4. Question about going to a technical school
    By Goalie35 in forum C++ Programming
    Replies: 1
    Last Post: 08-30-2001, 11:34 AM