DECLARE SUB GetData (org$, dates$, loc$, mealsEnt!, airFare!, lodging!, taxi!)
DECLARE SUB OtherTotals (airFare!, lodging!, taxi!, total!)
DECLARE SUB ComputePercent (mealsEnt!, pct!)
DECLARE SUB Prt (org$, dates$, loc$, mealsEnt!, airFare!, lodging!, taxi!, pct!, other!)
REM**************************************************************
REM Barb Meester
REM Chapter 4, Programming Project 5, Page 141
REM file name:  TravlExp
REM *************************************************************
REM
REM Generate a Business Travel Expense attachment
REM
CLS
REM******************SUBROUTINES********************************
REM SUB GetData will ask the user to input data
REM Sub OtherTotal deals with computing everything except meals and ent
REM ComputePercent computes 50% for meals and entertainment
REM Prt will print the report
REM
CALL GetData(org$, dates$, loc$, mealsEnt, airFare, lodging, taxi)
CALL OtherTotals(airFare, lodging, taxi, other)
CALL ComputePercent(mealsEnt, pct)
CALL Prt(org$, dates$, loc$, mealsEnt, airFare, lodging, taxi, pct, other)
END

SUB ComputePercent (mealsEnt, pct)
  REM Compute 50% of meals and entertainment
  LET pct = mealsEnt * .5
END SUB

SUB GetData (org$, dates$, loc$, mealsEnt, airFare, lodging, taxi)
  REM Accept input data from user
  INPUT "Enter organization visited: ", org$
  INPUT "Enter date: ", dates$
  INPUT "Enter location: ", loc$
  INPUT "Enter expenses for meals and entertainment: ", mealsEnt
  INPUT "Enter airline fare: ", airFare
  INPUT "Enter expenses for lodging: ", lodging
  INPUT "Enter taxi fares: ", taxi
END SUB

SUB OtherTotals (airFare, lodging, taxi, total)
  REM Compute total for all amounts except meals and entertainment
  LET total = airFare + lodging + taxi
END SUB

SUB Prt (org$, dates$, loc$, mealsEnt, airFare, lodging, taxi, pct, other)
  REM Print out summary of information
  PRINT "Business Travel Expense"
  PRINT
  PRINT "Trip to attend meeting of"
  PRINT org$
  PRINT dates$; " in "; loc$
  PRINT
  PRINT USING "Meals and Entertainment    $$###.##"; mealsEnt
  PRINT USING "Airplane Fare              $$###.##"; airFare
  PRINT USING "Lodging                    $$###.##"; lodging
  PRINT USING "Taxi Fares                 $$###.##"; taxi
  PRINT
  PRINT "Totals Other than Meals and Entertainment: ";
  PRINT USING "$$###.##"; other
  PRINT
  PRINT USING "50% of Meals and Entertainment: $$###.##"; pct
END SUB

    Source: geocities.com/meesteb