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
CS Lab ARM Advance Program
Gasoline Pump
Objective: The objective of this assignment is to have the students build upon the skills from
ARM Lab 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 types of gasoline, regular, midgrade, premium. The price per gallon in cents is given in the following table.
The initial inventory level is tenths of gallons 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 MidGrade 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 RM 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 $ and no more than $ and any noninteger inputs. For example:
Enter Dollar amount to dispense At least and no more than
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 gallon 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 gallon each then display final inventory levels and dollar amounts dispensed by grade and shut the pump off ie 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 ie 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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
