Java Assignment Help : Travel Expenses calculator

Please do Project #1 from Ch. 12, Programming Challenges, #4



Java Assignment Help : Travel Expenses calculator
Java Assignment Help : Travel Expenses calculator



Some help.

Let

days – number of days on the trip,

air – amount of airfare, if any,

carRentalActual – amount of car rental fees, if any,

miles – number of miles driven, if a private vehicle was used,

parkingActual – amount of parking fees, if any,

taxiActual - amount of taxi charges, if any,

reg – conference or seminar registration fee, if any,

lodgingPerNightActual – lodging charges per night,

DAILY_MEAL_RATE = 37.0,


MAX_PARKING_FEES = 10.0,

MAX_TAXI = 20.0,

MAX_LODGING_PER_NIGHT = 95.0,

MILEAGE_RATE = 0.27.

Then reimbursement may be calculated as

reimbursable = (days * DAILY_MEAL_RATE) + parkingRe + taxiRe +

(miles * MILEAGE_RATE) + lodgingRe +

carRentalActual + air + reg,

where parkingRe is the minimum of parkingActual and (MAX_PARKING_FEES

* days),

taxiRe is the minimum of taxiActual and (MAX_TAXI * days),

lodgingRe is the minimum of (lodgingPerNightActual * days) and

(MAX_LODGING_PER_NIGHT * days).

Allowable expenses should be calculated as the maximum expenses

that company will reimburse. Of course company will not permit

mutually exclusive events. For example you cannot rent a car and take

a taxi simultaneously.

195 views0 comments