All pastes #14932 Raw Edit

Stuff

public text v1 · immutable
#14932 ·published 2005-06-18 05:12 UTC
rendered paste body
CLS
INPUT "How many items to be calculated?", totalItems%
DIM itemName$(1 TO totalItems%)  'declare arrays
DIM itemCost!(1 TO totalItems%)
DIM numItems%(1 TO totalItems%)
DIM totalCost!(1 TO totalItems%)
FOR i% = 1 TO totalItems% 'get inputs/loop
        CLS
        PRINT "Item "; i%'current item number
        PRINT
        INPUT "Item name -- ", itemName$(i%)
        INPUT "Item cost -- ", itemCost!(i%)
        INPUT "Quantity -- ", numItems%(i%)
        totalCost!(i%) = itemCost!(i%) * numItems%(i%)
NEXT i%
CLS
PRINT "Summary"
PRINT
format$ = "\            \  $$#,###.##  #,###    $$#,###,###.##"
        PRINT "Item Name        Item Cost   Quantity    Total Cost  "
        PRINT "----------       ---------   --------    ------------"
FOR i% = 1 TO totalItems%
        PRINT USING format$; itemName$(i%); itemCost!(i%); numItems%(i%); totalCost!(i%)
        netTotal! = netTotal! + totalCost!(i%)
NEXT i%
PRINT
PRINT "Net Total = "; netTotal!
END