Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '*************************************...
- '* THIS PROGRAM IS TO CALCULATE CAR RENTAL REVENUE GENERATED *
- '*************************************...
- 'VARIABLE USED:
- 'T1$, H1$, H2$, D1$ Customer Name
- 'NAM $ Employee Name
- 'VEHICALTYPE$ Vehicle Type
- 'MILAGE Miles Traveled
- 'RATE Vehicle Rate
- 'DAYS Days Held
- 'TOTAL Total Revenue Generated Per Account
- '*************************************...
- '* PROGRAM MAINLINE *
- '*************************************...
- CLS
- GOSUB InitializeVariables
- GOSUB PrintHeadings
- GOSUB ProcessDetail
- GOSUB CalculateAnswer
- END
- '*************************************...
- '* INITILIZE VARIABLES *
- '*************************************...
- InitializeVariables:
- LET T1$ = " CAR RENTAL AUGUST 2011 "
- LET H1$ = " Customer Vehical Days Miles Total Cost"
- LET H2$ = " Name Type Held Traveled For Rental"
- LET D1$ = "/ / / / ## #### ######"
- '*************************************...
- '* PRINT HEADINGS *
- '*************************************...
- PrintHeadings:
- PRINT
- PRINT T1$ 'Print Title Line
- PRINT
- PRINT H1$ 'Print Column Heading, Line 1
- PRINT H2$ 'Print Column Heading, Line 2
- PRINT
- RETURN
- '*************************************...
- '* PROCESS DETAIL *
- '*************************************...
- ProcessDetail:
- GOSUB ReadData 'Prime the data read
- DO UNTIL UCASE$(NAM$) = "END"
- GOSUB CalculateVehicalCost
- GOSUB CalculateAnswer
- GOSUB ReadData
- LOOP
- RETURN
- '*************************************...
- '* READ DATA *
- '*************************************...
- ReadData:
- READ NAM$, VehicalType$, DaysHeld, MilesTraveled
- DATA "Jones","Large",6,500
- DATA "Smith","Compact",17,3000
- DATA "Baker","Intermediate",8,250
- DATA "Williams","Intermediate",4,1000
- DATA "Winston","Large",3,500
- DATA "END",0,0,0
- RETURN
- '*************************************...
- '* CALCULATE VEHICAL COST *
- '*************************************...
- CalculateVehicalCost:
- LET Compact = (MilesTraveled * .15)
- LET Intermediate = (MilesTraveled * .18)
- LET Large = (MilesTraveled * .22)
- '*************************************...
- '* CALCULATE ANSWER *
- '*************************************...
- CalculateAnswer:
- LET TotalCostForRental = (VehicalType * DaysHeld)
- '*************************************...
- '* PRINT DETAIL *
- '*************************************...
- PrintDetail:
- PRINT USING D1$; NAM$, VehicalType, DaysHeld, MilesTraveled
- RETURN
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement