This is my question
Travel Expenses Claim
Write a program that calculates and displays the total travel expenses of a
businessman on a trip.
The program should have functions and apply all the
control techniques that ask for and return the following:
· The total number of days spent on the trip
· The time departure on the first day of the trip, and the time of arrival back
home on the last day of the trip
· The amount of any round-trip airfare
· The amount of any car rentals
· Kilometers driven, if a private vehicle was used. Calculate the vehicle
expense as RM4.00 per km driven
· Parking fees (The company allows up to RM6.00 per day only)
· Taxi fees if any (The company allows up to RM10.00 per day only)
· Conference or seminar registration fees
· Hotel expenses (The company allows up to RM180.00 per night for
lodging)
The program should calculate and display the total expenses incurred by the
businessman and the total allowable expenses for the trip.
This is my code :-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
#include <iostream>
using namespace std;
int totalDays;
double departureTime;
double arrivalTime;
double airfareAmount;
double carRental;
double privateVehicle;
double privateVehicleexpense;
double parkingFee;
double taxiFee;
double conf_regFee;
double hotelAmount;
double totalExpense;
double totalAllowexpense;
int main()
{
int totalDaysin;
double departureTimein;
double arrivalTimein;
double airfareAmountin;
double carRentalin;
double privateVehiclein;
double parkingFeein;
double taxiFeein;
double conf_regFeein;
double hotelAmountin;
cout << "Enter total number of days spent on the trip : ";
cin >> totalDaysin;
cout << "\n\nEnter the departure time on the first day of the trip (19.20) : ";
cin >> departureTimein;
cout << "\n\nEnter the arrival time on the last day of the trip (19.20) : ";
cin >> arrivalTimein;
cout << "\n\nEnter total amount spent on round-trip airfare : RM ";
cin >> airfareAmountin;
cout << "\n\nEnter total amount spent on car rentals : RM ";
cin >> carRentalin;
cout << "\n\nEnter total kilometres driven : ";
cin >> privateVehiclein;
cout << "\n\nEnter total parking fees : RM ";
cin >> parkingFeein;
cout << "\n\nEnter total taxi fees : RM ";
cin >> taxiFeein;
cout << "\n\nEnter total conference or seminar registration fees : RM ";
cin >> conf_regFeein;
cout << "\n\nEnter total hotel expenses : RM ";
cin >> hotelAmountin;
cout << "\n\n\n\n\nTotal days spent on trip : " << totalDaysin << " Days " << endl;
cout << "\nDeparture time on first day of trip : " << departureTimein << endl;
cout << "\nArrival time on last day of trip : " << arrivalTimein << endl;
cout << "\nTotal round-trip airfare : RM " << airfareAmountin << endl;
cout << "\nTotal car rental fee : RM " << carRentalin << endl;
cout << "\nTotal kilometres driven for private vehicle : " << privateVehiclein << " Kilometres " << endl;
privateVehicleexpense = privateVehiclein * 4.00;
cout << "\nTotal private vehicle expenses : RM " << privateVehicleexpense << endl;//calculation
cout << "\nTotal parking fees : RM " << parkingFeein << endl;
cout << "\nTotal taxi fees : RM " << taxiFeein << endl;
cout << "\nTotal conference or seminar registration fees : RM " << conf_regFeein << endl;
cout << "\nTotal hotel expenses : RM " << hotelAmountin << endl ;
totalExpense = airfareAmountin + carRentalin + privateVehicleexpense + parkingFeein + taxiFeein + conf_regFeein + hotelAmountin;
cout << "\n\nTotal expenses : RM " << totalExpense << endl;//calculation
totalAllowexpense = airfareAmountin + carRentalin + privateVehicleexpense + 6.00 + 10.00 + conf_regFeein + 180.00 ;
cout << "\nTotal allowable expenses : RM " << totalAllowexpense << endl;//calculation
cout << "\n\n\n\n\n" ;
return 0;
}
|
The above code is working nicely . But , the question states that the code need to include application of
"CONTROL TECHNIQUE" . Can anyone help me on how to do it....???