csci 10 :: programming project 1 (due before midnight on fri, oct 7)
Submitting your work: Complete this exercise on your own.

Solve the problem described below by designing, implementing, and testing a HLA console application.

Email your source (your .hla file) to the instructor at before the deadline.


The purpose of this project is for you to practice and use the HLA/assembly programming skills you learn between the first day of class and the project deadline. These skills include HLA I/O, data types, and control structures, and a variety of assembly arithmetic instructions.

NOTE: You may only use integers in this program, so you will have to design the program to operate on "credits", where 1 credit is equal to one cent US currency (100 "credits" in the program will be the equivalent of 1 US dollar).

Create a simple simulation of a vending machine, with a minimum of five (5) products from which to choose. The simulated vending machine should function as follows:

  1. the user is shown a list of products, with inventory counter and credits that each will cost
    • each product should have a counter that tracks how many of that product are left in inventory -- each time the user "buys" one of a product, the counter will go down by one
  2. the user is prompted for a selection, and an appropriate selection is read -- users must be prevented from selecting "sold out" items
  3. the user is prompted to enter credits as payment -- do not let the user proceed until adequate credits have been provided
  4. calculate and display the amount of change the customer will receive and "break down" the change to dollars (100 credits), quarters (25 credits), dimes (10 credits), nickels (5 credits), and pennies (1 credit)
    • EXAMPLE: The user purchased 33 credits worth of items, and paid 100 credits. The user is due 67 credits of change in the form of 0 dollars, 2 quarters, 1 dime, 1 nickel, and 2 pennies.
  5. product stock is then adjusted down per the user's purchase
  6. let the user choose to purchase another item or exit the program
    • if the user chooses to keep shopping, loop back to the top of the program and show the user the product selections again (inventory counters will NOT be reset)
    • if the user chooses to stop shopping, show them a "receipt" that displays:
      • quantity of each item purchased and total cost of that item
      • total cost of all products purchased

Total points for this programming project:

750 points