'############################################################################
'Tyler Duzan CIT-120 Take Home Test
'############################################################################
'Process_customer_record
'Adapted from pseudo-code on page 43 of Simple Program Design
CLS
INPUT "How many totals need to be calculated? ", totCust%
DIM purAmnt!(1 TO totCust%)
DIM cusName$(1 TO totCust%)
DIM taxCode%(1 TO totCust%)
DIM saleTax!(1 TO totCust%)
DIM totCost!(1 TO totCust%)
'############################################################################
' Input Loop, TaxCode determination, and Cost calculation
'############################################################################
FOR i% = 1 TO totCust%
CLS
PRINT "Customer "; i%
PRINT
INPUT "Tax Code: ", taxCode%(i%)
INPUT "Purchase Amount: ", purAmnt!(i%)
INPUT "Customer Name: ", cusName$(i%)
IF taxCode%(i%) = 0 THEN saleTax!(i%) = 0 ELSE
IF taxCode%(i%) = 1 THEN saleTax!(i%) = purAmnt!(i%) * .03 ELSE
IF taxCode%(i%) = 2 THEN saleTax!(i%) = purAmnt!(i%) * .05 ELSE saleTax!(i%) = purAmnt(i%) * .07
totCost!(i%) = purAmnt!(i%) + saleTax!(i%)
NEXT i%
'############################################################################
' Report generation and formatting
'############################################################################
CLS
PRINT "Report"
PRINT
format$ = "\ \ $$##,###.## $$##,###.## $$##,###.## "
PRINT "Customer Name Purchase Amount Sales Tax Total "
PRINT "------------- --------------- --------- ---------"
FOR i% = 1 TO totCust%
PRINT USING format$; cusName$(i%); purAmnt!(i%); saleTax!(i%); totCost!(i%)
NEXT i%
PRINT
PRINT "Thank You"
'THE
END