fundamentals of programming

The ACME Company has approached you with a request to develop the psuedocode that will control the operations of their new series of vending machines. The program will be required to maintain the product inventory and money reservoir. The program should do the following operations:

1. Take as input an item number and money (The program terminates when a user enters a negative money amount and “000” as an item number.)

2. Check to see if the item exists. (if it doesn’t give the user a chance to re-enter the number)

3. Check to see if the money is sufficient enough to pay for item. (If not request more money)

4. Check to see if item is in stock. (If not user should be notified with the choice of selecting new item or cancelling the order)

5. If the item is in stock and the money is sufficient, the program should provide change and update the money reservoir and product inventory.

6. When the dispensing change, the program must insure that it always returns the correct amount of change based on the coins available in the reservoir. For example, if a user is owed $0.30 then the program may return 1 quarter and 1 nickel. However, if there are no quarters, the program should be smart enough to return a different combination of that doesn’t include quarters. (If no combination of change exists, the user’s order should be cancelled and the user should be allowed to make an alternate selection)

7. Once a transaction is complete, the user should be prompted to make a new selection. The program will end when a user enters a negative money amount and “000” for the item number.

Product Inventory:

Below is a breakdown of the products offered by the vending machine. In addition to the product names, the prices, item number and quantities are also listed below. The user will use the item number to select the product they wish to purchase.

Product Name Item Number Price Quantity in Stock

Candy Bar 123 $0.60 60

Gum 124 $0.35 75

Potato Chips 125 $0.75 40

Trail Mix 126 $.050 50

Breakfast Bar 127 $0.80 45

  1. 👍 0
  2. 👎 0
  3. 👁 115

Respond to this Question

First Name

Your Response

Similar Questions

  1. Math

    The Acme Candy Company claims that 60% of the jawbreakers it produces weigh more than .4 ounces. Suppose that 800 jawbreakers are selected at random form the production lines. Would it be unusual for this sample of 800 to contain

  2. Social studies plz answer any plz

    1. Why did the interaction between the settlers in Texas and the Mexican government develop and change over time 2. How did Manifest Destiny impact the US governments position on the Texans request to be annexed? 3. Why were

  3. Algebra 2

    James sold magazine subscriptions with three prices: $26, $19, $ 23. He sold 3 fewer of the $26 subscriptions than of the $19 subscriptions and sold a total of 32 subscriptions. If his total of sales amounted to $716, how many $23

  4. Guidance and discipline

    If children do not develop a competence in fundamental skills of movement they may: A. Never develop fine motor skills B. Lose muscle tone C. Develop poor body image D. Be clumsy in physical actions. Is it C ?

  1. Business law

    Ashley sees a maintenance crew from Acme Co. beginning to resurface her driveway, a service she has not contracted for. Ashley thinks a new driveway would be good, so she doesn’t say anything. If Acme sues Ashley for the value

  2. Civics

    11. The purpose of the petition sent to King George III by the First Continental Congress was to A. request a place in Parliament for colonial delegates. B. request that the king consider granting independence to the established

  3. Advanced Accounting

    Stockholders of Acme Company, Baltic Company, and Colt Company are considering alternative arrangements for a business combination. Balance sheets and the fair values of each company's assets on October 1, 2004, were as follows:

  4. HR

    To select a training service, the organization mails a(n) _______ to several vendors. A. training-needs analysis B. request for proposal C. affirmative-action plan D. request for training Not sure if the answer is A or D

  1. history

    1. Why did the interaction between the settlers in Texas and the Mexican government develop and change over time 2. How did Manifest Destiny impact the US governments position on the Texans request to be annexed? 3. Why were

  2. Accounting (Please Help)

    Acme, Inc.'s books show an ending cash balance of $14,500 before preparing the bank reconciliation. Given the bank reconciliation shows outstanding checks of $3,900, deposits in transit of $2,900, NSF check of $190, and interest

  3. statistics

    The Acme Candy Company claims that 60% of the jawbreakers it produces weigh more than .4ounces. Suppose that 800 jawbreakers are selected at random from the production lines. Would it be unusual for this sample of 800 to contain

  4. HR

    In personnel forecasting, an effective HR professional tries to A. determine the supply of and demand for various types of human resources. B. predict the number and types of legal challenges the company is likely to face within

You can view more similar questions or ask a new question.