You are on page 1of 5

Declare Count1 = Integer

Declare Count2 = Integer


Declare Item1 as Float
Declare Item2 as Float
Declare Item3 as Float
Declare Item4 as Float
Declare ItemPrice1 as Float
Declare ItemPrice2 as Float
Declare ItemPrice3 as Float
Declare ItemPrice4 as Float
Declare SubTotal as Float
Declare Total as Float
Declare SalesTax as Float
Declare ZIP as Integer
Declare PIN as Integer
Declare Slot1 as Float
Declare Slot2 as Float
Declare Slot3 as Float
Declare Slot4 as Float
Declare Slot5 as Float
Declare Slot6 as Float
Declare Camera1 as Float
Declare Camera2 as Float
Declare Camera3 as Float
Declare Camera4 as Float
Declare Camera5 as Float
Declare Camera6 as Float
Declare ChangeDue as Float
Display Welcome to The Supermarket

Display Do you have any discount cards? Enter Y for yes, N for no
Input Response
If Response is Y Then
Write Please slide card
Input Card
Else
End If
Display Please place your items in the bin to the right
Set Count1 = 0
Display Please scan your first item
Input Item1
Input ItemPrice1
Display Item1, ItemPrice1
Display Please scan your next item
Input Item2
Input ItemPrice2
Display Item2, ItemPrice2
Display Your Subtotal price is: $ + ItemPrice1+Itemprice2
Display Please scan your next item
Input Item3
Input ItemPrice3
Display Item3, ItemPrice3
Display Your Subtotal price is: $ + ItemPrice1+Itemprice2+Itemprice3
Display Please scan your next item
Input Item4
Input ItemPrice4
Display Item4, ItemPrice4
Display Your Subtotal is: $ + ItemPrice1+Itemprice2+Itemprice3+Itemprice4
SetCount2 = 0 + Count1

If Count2 < Count1 Then


Display Please scan missing item
Pause one minute
If Count2 < Count1 Then
Display Please see attendant for assistance
Else
End If
Set SubTotal = ItemPrice1+Itemprice2+Itemprice3+Itemprice4
Set SalesTax = 0.07*SubTotal
Set Total = SalesTax+SubTotal
Display Your final total is: $ + Total
Display Will you be using credit or debit card? Type Y for yes, N for no
Input Response
If Response is Y Then
Display Is this a credit or debit card? Type C for Credit, D for Debit
Input Response
If Response is C Then
Display Enter your ZIP code
Input ZIP
Compare ZIP to customer database
Else
If Response is D Then
Display Enter your PIN
Input PIN
Compare PIN to customer database
Else
If Response is N Then
Display Please deposit coins first
Input Coins

Set Slot1 = .01


Set Slot2 = .05
Set Slot3 = .10
Set Slot4 = .25
Set Slot5 = .50
Set Slot6 = 1.00
Display Please deposit paper money
Input PaperMoney
Set Camera1 = 1.00
Set Camera2 = 5.00
Set Camera3 = 10.00
Set Camera4 = 20.00
Set Camera5 = 50.00
Set Camera6 = 100.00
Set Coins = Slot1+Slot2+Slot3+Slot4+Slot5+Slot6
Set PaperMoney = Camera1+Camera2+Camera3+Camera4+Camera5+Camera6
Display Amount due: $ + Total-(Coins+PaperMoney)
Set ChangeDue = Total-(Coins+PaperMoney)
If ChangeDue >= 100 Then
ChangeDue = Camera6
If ChangeDue >= 50 Then
ChangeDue = Camera5
If ChangeDue >= 20 Then
ChangeDue = Camera4
If ChangeDue >= 10 Then
ChangeDue = Camera3
If ChangeDue >= 5 Then
ChangeDue = Camera2

If ChangeDue >=1 Then


ChangeDue = Camera1
If ChangeDue >= .50 Then
ChangeDue = Slot5
If ChangeDue >= .25 Then
ChangeDue = Slot4
If ChangeDue >= .10 Then
ChangeDue = Slot3
If ChangeDue >= .05 Then
ChangeDue = Slot2
If ChangeDue >= .01 Then
ChangeDue = Slot1
End If
End If
End If
Display Change Due: ? + ChangeDue
Display Thank you! Please wait while your receipt is printed.
Print Item1, ItemCost1
Print Item2, ItemCost2
Print Item3, ItemCost3
Print Item4, ItemCost4
Print SalesTax
Print Special: Fresh baked bread, buy one, get off the second one
Print Please call (555) 555-5555 for any questions or concerns
Print Please visit http://www.thesupermarket.com for an online customer satisfaction survey
Print Thank you for shopping at The Supermarket. Please come back again!

You might also like