Question: CS 3 0 9 Lab 5 ARM Advance Program Gasoline Pump Objective: The objective of this assignment is to have the students build upon the

CS309 Lab 5 ARM Advance Program
Gasoline Pump
Objective: The objective of this assignment is to have the students build upon the skills from
ARM Lab 4 for a more complex ARM Assembly program. The students will have to track multiple items forcing the use of memory or the stack to save and restore data values.
Your program will simulate operation of a gasoline pump.
The pump will dispense three (3) types of gasoline, regular, mid-grade, premium. The price per gallon (in cents) is given in the following table.
The initial inventory level is 500 tenths of gallons (50 gallons) per grade. You should keep all values (gallons, price per gallon and dispense amount) in integer format. Note: based on the numbers above it is not possible to dispense all the Mid-Grade gasoline.
When the program starts it shall display an identification and the current inventory level. For example:
Welcome to gasoline pump.
Current inventory of gasoline (in tenths of gallons) is:
Dollar amount dispensed by grade:
The program shall then prompt the user for the grade to dispense and the selection displayed. For example:
Select Grade of gas to dispense ( R,M or P )
R
You selected Regular.
The pump shall then prompt the user for the dollar amount to dispense. The program shall reject
any invalid dollar amounts (at least $1 and no more than $50) and any non-integer inputs. For example:
Enter Dollar amount to dispense (At least 1 and no more than 50)
10
40 tenths of gallons have been dispensed.
Prior to dispensing gasoline, the pump shall ensure there is enough gasoline to meet the request. If there is not enough gasoline to meet the request the user shall be notified and prompted to enter a new (lower) dollar amount.
If any grade of gasoline drops below 1 gallon (10 tenths of gallons) consider it to be an insufficient amount to dispense and do not allow the user to select that grade to dispense. When all three grades drop below 1 gallon each then display final inventory levels and dollar amounts dispensed by grade and shut the pump off (i.e., stop the program and return control to the operating system).
Your program should check for and reject any invalid inputs for grade selection and dollar amounts. The pump shall allow the entry of a hidden code at the main prompt (i.e., Select Grade). When this hidden code is entered the pump shall display the inventory level of gasoline and the dollar amount dispensed by grade so far
CS 3 0 9 Lab 5 ARM Advance Program Gasoline Pump

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!