It/210 Checkout Apllication

Only available on StudyMode
  • Download(s) : 72
  • Published : May 1, 2012
Open Document
Text Preview
Associate Program Material
Appendix F

Application-Level Requirements

Application-Level Requirements List

1. The program shall be a basic checkout calculator

2. The program will display a series of screens prompting the user to enter the item name or number, price and quantity.

3. The program will ask to enter any additional items.

4. The program will award a 10% discount if more than four items are purchased of one kind.

5. The program will calculate and display a final tax based on a 7.5% sales tax.

6. The program will calculate and display a subtotal.

7. The program will calculate and display a final total for the items that are purchased.

Input-Process-Output Chart

Complete the following input-process-output chart for the application using a structured programming approach.

Input| Process| Output|
ResponseItemNameOrNumberItemQuantityItemPrice| Get User Input| ItemTotalSubtotalItemQuantityItemPrice| ItemQuantityItemPrice| Calculate Discount Price| Subtotal| Subtotal| Calculate Sales Tax| SubtotalFinalTax|

SubtotalFinalTax| Calculate Totals| FinalTaxSubtotalFinalTotal| FinalTaxSubtotalFinalTotal| Display Total| FinalTaxSubtotalFinalTotal|

Hierarchy Chart

Complete a hierarchy chart for the application by typing into the textboxes below.

Main Module

User Input Module

Calculate Sales Tax Module
Calculate Discount Price Module

Display Total Price Module
Calculate Sales Total Module

Main module
Declare ItemNameOrNumber as String
Declare Response as String
Declare ItemQuantity as Integer
Declare ItemPrice as Real
Declare ItemTotal as Real
Declare Subtotal as Real
Declare FinalTax as Real
Declare FinalTotal as Real
Write “Basic Checkout Calculator”
Write “This program computes sales tax and displays the subtotal.”
Write “and final total.”
Call Get Input Module
Call Calculate Sales Total Module
Call Display Total Price Module
End Main Module
Get Input Module
Write “Would you like to start an order?”
Write “Enter ‘y’ for yes, ‘n’ for no: “
Input Response
Set Subtotal =0
Set ItemTotal=0
Set FinalTax=0
Set FinalTotal =0
While Response = “y”
Write “Please enter item name or number."
Input ItemNameOrNumber
Write "Please enter Item quantity."
Input ItemQuantity
Write "Please enter item price."
Input ItemPrice
If ItemQuantity > 4 then
Set ItemTotal = ItemPrice* ItemQuantity – (ItemPrice * ItemQuantity * 0.10)
Set Subtotal = ItemTotal + Subtotal
Else
Set ItemTotal = ItemPrice * ItemQuantity
Set Subtotal = ItemTotal + Subtotal
End if
Write “Would you like to add another item?”
Write “Enter ‘y’ for yes, ‘n’ for no: “
Input Response
End While
End Get Input Module
Calculate Sales Total Module
FinalTax = Subtotal * 0.075
FinalTotal = Subtotal + FinalTax
End Calculate Sales Total Module
Display Total Price Module
Write “The Final Tax is: + FinalTax
Write “The Subtotal is:” + Subtotal
Write “The total Price is:" + FinalTotal
End Display Total Price Module

Start
ItemTotal ? 0
FinalTax ? 0
FinalTotal ? 0
Subtotal ? 0
"Would you like to
start an order?"
GET Response
Response="Y
"
"Item Name or Number"
GET ItemNameOrNumber
"Item Quantity"
GET ItemQuantity
"Item price"
GET ItemPrice
ItemQuantity
>= 4
ItemTotal ? (ItemPrice *
ItemQuantity) - (ItemPrice *
ItemQuantity * 0.10)
ItemTotal ? ItemPrice
* ItemQuantity
No
Yes
"Would you like to add
another item?"
GET Response
Subtotal ? ItemTotal
+ Subtotal
FinalTax ? FinalTax
+ Subtotal * ( .075)
FinalTotal ? Subtotal
+ FinalTax
PUT "the Subtotal is"
+Subtotal¶
PUT "the final tax is" +
FinalTax¶
PUT "the finalTotal is"
+ FinalTotal¶
End
No
Yes
Loop
tracking img