Constants declared at the Form level

' Class-level constants

ConstintMIN_DAYSAsInteger = 1 ' Minimum number of days of the trip is 1.

ConstdecMEALS_PER_DAYAsDecimal = 37D ' Reimbursement for meals each day is $37.00

ConstdecPARKING_PER_DAYAsDecimal = 10D ' Reimbursement for parking each day is $10.00

ConstdecTAXI_PER_DAYAsDecimal = 20D ' Reimbursement for taxi each day is $20.00

ConstdecLODGING_PER_DAYAsDecimal = 95D ' Reimbursement for lodging each day is $95.00

ConstdecCENTS_PER_MILEAsDecimal = 0.27D ' Reimbursement per mile driven is $0.27

Local variables in the btnCalculate_Click procedure

DimintDaysAsInteger = 0 ' To hold the number of days of the trip

DimintMilesAsInteger = 0 ' To hold the number of miles driven in a private vehicle

DimdecAirfareAsDecimal = 0D ' To hold the amount of airfare

DimdecCarRentalAsDecimal = 0D ' To hold the amount of car rental fees

DimdecParkingAsDecimal = 0D ' To hold the amount of parking fees

DimdecTaxiAsDecimal = 0D ' To hold the amount of taxi charges

DimdecRegistrationAsDecimal = 0D ' To hold the conference or seminar registration fees

DimdecLodgingAsDecimal = 0D ' To hold the lodging charges per night

DimdecMealsAsDecimal = 0D ' To hold the amount charged for meals

DimdecMilesReimbursedAsDecimal ' To hold the amount reimbursed for miles driven in a private vehicle

DimdecParkingReimbursedAsDecimal ' To hold the amount reimbursed for parking fees

DimdecTaxiReimbursedAsDecimal ' To hold the amount reimbursed for taxi charges

DimdecLodgingReimbursedAsDecimal ' To hold the amount reimbursed for lodging

DimdecMealsReimbursedAsDecimal ' To hold the amount reimbursed for meals

DimdecParkingSavingsAsDecimal ' To hold the amount saved on parking fees

DimdecTaxiSavingsAsDecimal ' To hold the amount saved on taxi charges

DimdecLodgingSavingsAsDecimal ' To hold the amount saved on lodging

DimdecMealsSavingsAsDecimal ' To hold the amount saved on meals

DimdecParkingExcessAsDecimal ' To hold the amount exceeded on parking fees

DimdecTaxiExcessAsDecimal ' To hold the amount exceeded on taxi charges

DimdecLodgingExcessAsDecimal ' To hold the amount exceeded on lodging

DimdecMealsExcessAsDecimal ' To hold the amount exceeded on meals

DimdecExpensesAsDecimal = 0D ' To hold the total expenses incurred

DimdecReimbursementsAsDecimal = 0D ' To hold the total allowable expenses for the trip

DimdecExceedingsAsDecimal = 0D ' To hold the excess that must be paid

DimdecSavingsAsDecimal = 0D ' To hold the amount saved if the expenses were under the total

Calculate Event Pseudocode

If Travel Days is a number and meets the minimum number required Then

If Private Vehicle Miles is Empty or value is a positive whole number Then

If Airfare is Empty or value is a positive real number Then

If Car Rental Fees is Empty or value is a positive real number Then

If Parking Fees is Empty or value is a positive real number Then

If Taxi Charges is Empty or value is a positive real number Then

If Registration Fees is Empty or value is a positive real number Then

If Lodging Per Night is Empty or value is a positive real number Then

If Meals is Empty or value is a positive real number Then

Calculate reimbursement for each reimbursable expense (using following functions)

CalcMeals(Travel Days, Meals)

CalcParkingFees(Travel Days, Parking Fees)

CalcTaxiFees(Travel Days, Taxi Charges)

CalcLodging(Travel Days, Lodging Per Night)

CalcMileage(Private Vehicle Miles)

Calculate savings for each reimbursable expense (possibly using following functions)

CalcMealsSavings(Travel Days, Meals)

CalcParkingSavings(Travel Days, Parking Fees)

CalcTaxiSavings(Travel Days, Taxi Charges)

CalcLodgingSavings(Travel Days, Lodging Per Night)

Calculate excess spending for each reimbursable expense (possibly using functions)

CalcMealsUnallowed(Travel Days, Meals)

CalcParkingUnallowed(Travel Days, Parking Fees)

CalcTaxiUnallowed(Travel Days, Taxi Charges)

CalcLodgingUnallowed(Travel Days, Lodging Per Night)

Calculate the total of all expenses incurred by the business person

Calculate the total amount to be reimbursed for reimbursable expenses (using following function)

CalcTotalReimbursement(Meals Reimbursed, Private Vehicle Miles Reimbursed, Parking Fees Reimbursed, Taxi Charges Reimbursed, Lodging Per Night Reimbursed)

Calculate the total amount of excess spending for reimbursable expenses (using following function)

CalcUnallowed(Meals Excess, Parking Excess, Taxi Excess, Lodging Excess)

Calculate the total amount of savings for reimbursable expenses (using following function)

CalcSaved(Meals Savings, Parking Savings, Taxi Savings, Lodging Savings)

Display the information as output to the user

Else

Display a message to the user indicating that the amount for meals is invalid

End If

Else

Display a message to the user indicating that the amount for lodging charges is invalid

End If

Else

Display a message to the user indicating that the amount of registration fees is invalid

End If

Else

Display a message to the user indicating that the amount of the taxi charges is invalid

End If

Else

Display a message to the user indicating that the amount of parking fees is invalid

End If

Else

Display a message to the user indicating that the amount of car rental fees is invalid

End If

Else

Display a message to the user indicating that the amount of airfare is invalid

End If

Else

Display a message to the user indicating that the number of miles driven is invalid

End If

Else

Display a message to the user indicating that the number of days of the trip is invalid

End If

1