Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program using functions, arrays, and structures to calculate and display

ID: 3880556 • Letter: W

Question

Write a program using functions, arrays, and structures to calculate and display the total expenses for a business person on a trip. The following is input from the user: total number of days spent on the trip; time of departure on the first day of the trip; time of arrival back home on the last day of the trip; amount of round-trip airfare(if any); amount of car rental fees per day (if any); miles driven if a private vehicle was used per day; parking fees per day (if any); Taxi/Uber fees per day (if any); conference or seminar registration fees; hotel expenses per night; and the amount of each meal eaten, per day.
Additional Information:
•Total days on trip cannot be less than 1 or greater than 10. •Vehicle expense for personal vehicle use if 54.5 cents/mile. •Taxi/Uber fees: $20 max per day will be covered. •Parking fees: $6.00 max per day will be covered. •Hotel expenses: $110.00 max per night will be covered. •Meal expenses:
-On the first day of the trip •Breakfast is allowed if the departure time is before 7:00 am. •Lunch is allowed if the departure time is before 12:00 pm. •Dinner is allowed if the departure time is before 6:00 pm.
-On the last day of the trip: •Breakfast is allowed if the arrival time is after 7:00 am. •Lunch is allowed if the arrival time is before 1:00 pm. •Dinner is allowed if the arrival time is after 7:00 pm.
•Your program should only ask for ALLOWABLE meals. •Max covered prices are (per day that the business person is on a trip and is allowed these meals ) -Breakfast : $12.00 -Lunch: $15.00 -Dinner: $19.00
Your program should calculate and display the total expenses for each category; the total amount of expenses incurred; the total amount covered by the company, the total amount the employee will not be reimbursed for (if any) for anything spent over the max covered amounts.

This is what I’ve got so far. I need help with the logic and programming of this assignment please and thank you.
//Travel Expenses
#include<iostream> using namespace std;
struct Travel { int days; int timeDepart; int timeArrival; float airfare; float carRental; float milesDriven; float parkingFees; float taxiFees; float registrationFees; float hotelExpenses; float meals[10][3]; float totalSpent; float totalAllowed; string mealType[3]={"Breakfast", "Lunch", "Dinner"}; }; void getData(struct Travel &); double getCalc(struct Travel &);
int main() { struct Travel employee; getData(employee); return 0; }
void getData(struct Travel& employee) { cout<<"Enter the amount of days spent on the trip: "; cin>>employee.days; while(employee.days > 1 && employee.days > 10 ) { cout<<"Enter a valid number of days(less than 10 days) spent on the trip: "; cin>>employee.days; } cout<<"Enter the time of departure in Military Time (24-hour HHMM format): "; cin>>employee.timeDepart; while ( employee.timeDepart <0 || employee.timeDepart > 2400) { cout << "Enter a number between 0000 and 2400: "; cin >> employee.timeDepart; } cout<<"Enter the time of arrival in Military Time (24-hour HHMM format): "; cin>>employee.timeArrival; while ( employee.timeArrival <0 || employee.timeArrival > 2400) { cout << "Enter a number between 0000 and 2400: "; cin >> employee.timeArrival; } cout<<"Enter the amount of round-trip airfare: "; cin>>employee.airfare; while (employee.airfare < 0) { cout << "Enter an amount of round-trip airfare greater than 0: " ; cin >> employee.airfare; } cout<<"Enter the amount spent on car rental: "; cin>>employee.carRental; while (employee.carRental < 0) { cout << "Enter an amount spent on car rental greater than 0: " ; cin >> employee.carRental; } cout<<"Enter the miles driven if a private vehicle was used: "; cin>>employee.milesDriven; while (employee.milesDriven < 0) { cout << "Enter the number of miles driven greater than 0: " ; cin >> employee.milesDriven; } cout<<"Enter the parking fees if any: "; cin>>employee.parkingFees; while (employee.parkingFees < 0) { cout << "Enter an amount of parking fees greater than 0 if any or 0 if none: " ; cin >> employee.parkingFees; } cout<<"Enter the taxi fees: "; cin>>employee.taxiFees; while (employee.taxiFees < 0) { cout << "Enter an amount spent on taxis greater than 0 if any or 0 if none: " ; cin >> employee.taxiFees; } cout<<"Enter the registration fees: "; cin>>employee.registrationFees; while (employee.registrationFees < 0) { cout << "Enter an amount spent on registration fees greater than 0 or 0 if none: " ; cin >> employee.registrationFees; } cout<<"Enter the hotel expenses: "; cin>>employee.hotelExpenses; while (employee.hotelExpenses < 0) { cout << "Enter an amount spent on hotel expenses greater than 0 or 0 if none: " ; cin >> employee.hotelExpenses; } //int numDays=employee.days; for(int col=0; col<employee.days; col++) { for(int row=0; row<3;++row) { cout<<"Enter cost for "<<employee.mealType[row]<< " on day " <<col + 1 <<": "; cin>>employee.meals[col][row]; while (employee.meals[col][row] < 0) { cout << "Enter an amount spent on meals greater than 0 or 0 if none: " ; cin >> employee.meals[col][row]; } if(employee.days==1 && employee.timeDepart > 0 && employee.timeDepart <7000) { } } } }
double getCalc(struct Travel& employee) { float milesCost; float allowedTaxiFees, allowedParkingFees; allowedHotelExpenses; milesCost=employee.milesDriven*.545; for(int x=0;x<employee.days;x++) { allowedTaxiFees+= } } Write a program using functions, arrays, and structures to calculate and display the total expenses for a business person on a trip. The following is input from the user: total number of days spent on the trip; time of departure on the first day of the trip; time of arrival back home on the last day of the trip; amount of round-trip airfare(if any); amount of car rental fees per day (if any); miles driven if a private vehicle was used per day; parking fees per day (if any); Taxi/Uber fees per day (if any); conference or seminar registration fees; hotel expenses per night; and the amount of each meal eaten, per day.
Additional Information:
•Total days on trip cannot be less than 1 or greater than 10. •Vehicle expense for personal vehicle use if 54.5 cents/mile. •Taxi/Uber fees: $20 max per day will be covered. •Parking fees: $6.00 max per day will be covered. •Hotel expenses: $110.00 max per night will be covered. •Meal expenses:
-On the first day of the trip •Breakfast is allowed if the departure time is before 7:00 am. •Lunch is allowed if the departure time is before 12:00 pm. •Dinner is allowed if the departure time is before 6:00 pm.
-On the last day of the trip: •Breakfast is allowed if the arrival time is after 7:00 am. •Lunch is allowed if the arrival time is before 1:00 pm. •Dinner is allowed if the arrival time is after 7:00 pm.
•Your program should only ask for ALLOWABLE meals. •Max covered prices are (per day that the business person is on a trip and is allowed these meals ) -Breakfast : $12.00 -Lunch: $15.00 -Dinner: $19.00
Your program should calculate and display the total expenses for each category; the total amount of expenses incurred; the total amount covered by the company, the total amount the employee will not be reimbursed for (if any) for anything spent over the max covered amounts.

This is what I’ve got so far. I need help with the logic and programming of this assignment please and thank you.
//Travel Expenses
#include<iostream> using namespace std;
struct Travel { int days; int timeDepart; int timeArrival; float airfare; float carRental; float milesDriven; float parkingFees; float taxiFees; float registrationFees; float hotelExpenses; float meals[10][3]; float totalSpent; float totalAllowed; string mealType[3]={"Breakfast", "Lunch", "Dinner"}; }; void getData(struct Travel &); double getCalc(struct Travel &);
int main() { struct Travel employee; getData(employee); return 0; }
void getData(struct Travel& employee) { cout<<"Enter the amount of days spent on the trip: "; cin>>employee.days; while(employee.days > 1 && employee.days > 10 ) { cout<<"Enter a valid number of days(less than 10 days) spent on the trip: "; cin>>employee.days; } cout<<"Enter the time of departure in Military Time (24-hour HHMM format): "; cin>>employee.timeDepart; while ( employee.timeDepart <0 || employee.timeDepart > 2400) { cout << "Enter a number between 0000 and 2400: "; cin >> employee.timeDepart; } cout<<"Enter the time of arrival in Military Time (24-hour HHMM format): "; cin>>employee.timeArrival; while ( employee.timeArrival <0 || employee.timeArrival > 2400) { cout << "Enter a number between 0000 and 2400: "; cin >> employee.timeArrival; } cout<<"Enter the amount of round-trip airfare: "; cin>>employee.airfare; while (employee.airfare < 0) { cout << "Enter an amount of round-trip airfare greater than 0: " ; cin >> employee.airfare; } cout<<"Enter the amount spent on car rental: "; cin>>employee.carRental; while (employee.carRental < 0) { cout << "Enter an amount spent on car rental greater than 0: " ; cin >> employee.carRental; } cout<<"Enter the miles driven if a private vehicle was used: "; cin>>employee.milesDriven; while (employee.milesDriven < 0) { cout << "Enter the number of miles driven greater than 0: " ; cin >> employee.milesDriven; } cout<<"Enter the parking fees if any: "; cin>>employee.parkingFees; while (employee.parkingFees < 0) { cout << "Enter an amount of parking fees greater than 0 if any or 0 if none: " ; cin >> employee.parkingFees; } cout<<"Enter the taxi fees: "; cin>>employee.taxiFees; while (employee.taxiFees < 0) { cout << "Enter an amount spent on taxis greater than 0 if any or 0 if none: " ; cin >> employee.taxiFees; } cout<<"Enter the registration fees: "; cin>>employee.registrationFees; while (employee.registrationFees < 0) { cout << "Enter an amount spent on registration fees greater than 0 or 0 if none: " ; cin >> employee.registrationFees; } cout<<"Enter the hotel expenses: "; cin>>employee.hotelExpenses; while (employee.hotelExpenses < 0) { cout << "Enter an amount spent on hotel expenses greater than 0 or 0 if none: " ; cin >> employee.hotelExpenses; } //int numDays=employee.days; for(int col=0; col<employee.days; col++) { for(int row=0; row<3;++row) { cout<<"Enter cost for "<<employee.mealType[row]<< " on day " <<col + 1 <<": "; cin>>employee.meals[col][row]; while (employee.meals[col][row] < 0) { cout << "Enter an amount spent on meals greater than 0 or 0 if none: " ; cin >> employee.meals[col][row]; } if(employee.days==1 && employee.timeDepart > 0 && employee.timeDepart <7000) { } } } }
double getCalc(struct Travel& employee) { float milesCost; float allowedTaxiFees, allowedParkingFees; allowedHotelExpenses; milesCost=employee.milesDriven*.545; for(int x=0;x<employee.days;x++) { allowedTaxiFees+= } } Write a program using functions, arrays, and structures to calculate and display the total expenses for a business person on a trip. The following is input from the user: total number of days spent on the trip; time of departure on the first day of the trip; time of arrival back home on the last day of the trip; amount of round-trip airfare(if any); amount of car rental fees per day (if any); miles driven if a private vehicle was used per day; parking fees per day (if any); Taxi/Uber fees per day (if any); conference or seminar registration fees; hotel expenses per night; and the amount of each meal eaten, per day.
Additional Information:
•Total days on trip cannot be less than 1 or greater than 10. •Vehicle expense for personal vehicle use if 54.5 cents/mile. •Taxi/Uber fees: $20 max per day will be covered. •Parking fees: $6.00 max per day will be covered. •Hotel expenses: $110.00 max per night will be covered. •Meal expenses:
-On the first day of the trip •Breakfast is allowed if the departure time is before 7:00 am. •Lunch is allowed if the departure time is before 12:00 pm. •Dinner is allowed if the departure time is before 6:00 pm.
-On the last day of the trip: •Breakfast is allowed if the arrival time is after 7:00 am. •Lunch is allowed if the arrival time is before 1:00 pm. •Dinner is allowed if the arrival time is after 7:00 pm.
•Your program should only ask for ALLOWABLE meals. •Max covered prices are (per day that the business person is on a trip and is allowed these meals ) -Breakfast : $12.00 -Lunch: $15.00 -Dinner: $19.00
Your program should calculate and display the total expenses for each category; the total amount of expenses incurred; the total amount covered by the company, the total amount the employee will not be reimbursed for (if any) for anything spent over the max covered amounts.

This is what I’ve got so far. I need help with the logic and programming of this assignment please and thank you.
//Travel Expenses
#include<iostream> using namespace std;
struct Travel { int days; int timeDepart; int timeArrival; float airfare; float carRental; float milesDriven; float parkingFees; float taxiFees; float registrationFees; float hotelExpenses; float meals[10][3]; float totalSpent; float totalAllowed; string mealType[3]={"Breakfast", "Lunch", "Dinner"}; }; void getData(struct Travel &); double getCalc(struct Travel &);
int main() { struct Travel employee; getData(employee); return 0; }
void getData(struct Travel& employee) { cout<<"Enter the amount of days spent on the trip: "; cin>>employee.days; while(employee.days > 1 && employee.days > 10 ) { cout<<"Enter a valid number of days(less than 10 days) spent on the trip: "; cin>>employee.days; } cout<<"Enter the time of departure in Military Time (24-hour HHMM format): "; cin>>employee.timeDepart; while ( employee.timeDepart <0 || employee.timeDepart > 2400) { cout << "Enter a number between 0000 and 2400: "; cin >> employee.timeDepart; } cout<<"Enter the time of arrival in Military Time (24-hour HHMM format): "; cin>>employee.timeArrival; while ( employee.timeArrival <0 || employee.timeArrival > 2400) { cout << "Enter a number between 0000 and 2400: "; cin >> employee.timeArrival; } cout<<"Enter the amount of round-trip airfare: "; cin>>employee.airfare; while (employee.airfare < 0) { cout << "Enter an amount of round-trip airfare greater than 0: " ; cin >> employee.airfare; } cout<<"Enter the amount spent on car rental: "; cin>>employee.carRental; while (employee.carRental < 0) { cout << "Enter an amount spent on car rental greater than 0: " ; cin >> employee.carRental; } cout<<"Enter the miles driven if a private vehicle was used: "; cin>>employee.milesDriven; while (employee.milesDriven < 0) { cout << "Enter the number of miles driven greater than 0: " ; cin >> employee.milesDriven; } cout<<"Enter the parking fees if any: "; cin>>employee.parkingFees; while (employee.parkingFees < 0) { cout << "Enter an amount of parking fees greater than 0 if any or 0 if none: " ; cin >> employee.parkingFees; } cout<<"Enter the taxi fees: "; cin>>employee.taxiFees; while (employee.taxiFees < 0) { cout << "Enter an amount spent on taxis greater than 0 if any or 0 if none: " ; cin >> employee.taxiFees; } cout<<"Enter the registration fees: "; cin>>employee.registrationFees; while (employee.registrationFees < 0) { cout << "Enter an amount spent on registration fees greater than 0 or 0 if none: " ; cin >> employee.registrationFees; } cout<<"Enter the hotel expenses: "; cin>>employee.hotelExpenses; while (employee.hotelExpenses < 0) { cout << "Enter an amount spent on hotel expenses greater than 0 or 0 if none: " ; cin >> employee.hotelExpenses; } //int numDays=employee.days; for(int col=0; col<employee.days; col++) { for(int row=0; row<3;++row) { cout<<"Enter cost for "<<employee.mealType[row]<< " on day " <<col + 1 <<": "; cin>>employee.meals[col][row]; while (employee.meals[col][row] < 0) { cout << "Enter an amount spent on meals greater than 0 or 0 if none: " ; cin >> employee.meals[col][row]; } if(employee.days==1 && employee.timeDepart > 0 && employee.timeDepart <7000) { } } } }
double getCalc(struct Travel& employee) { float milesCost; float allowedTaxiFees, allowedParkingFees; allowedHotelExpenses; milesCost=employee.milesDriven*.545; for(int x=0;x<employee.days;x++) { allowedTaxiFees+= } }

Explanation / Answer

The above program is not correct as per my data. The program runs in infinite loop.

To calculate the total expenses with the information given follow the below program code , this might help you:

  #include <iostream>  #include <iomanip>    using namespace std;    int getDays(int);  void getTime (double&, double&);  double getAirfareAmount(double);  double getCarRentalAmount (double);  double getPrivateVechileExpense(double);  void getParkingAmount(double&,double&);  void getTaxiAmount(double&,double&);  double getRegistrationFee(double);  void getHotelAmount(double&,double&);  void getMealAmount (double&,double&);    //-----------------------------------------------------------------------------------------  //int main()  //Purpose :Displays a report based off of the functions the user has entered for the cost of the business expenses  //The program should perfom the neccessary calculations based off of the amount spent by the traveler.  //Preconditions: That the user has successfully input valid data for each question concerning the travel expenses.  //The main function which will call other functions for the travel expenses  //For the sake of calculations the depart and arrival time will use military  //time for depart and arrival time.  //Author: Cleotha Tucker  //----------------------------------------------------------------------------------------------------    int main()  {      int days = 0;       double arrivalTime;      double departureTime;      double airfareFee;      double carRentalFee;      double privateCarFee;      double vechileExpense;      double privateCarMilage = .38;      double parkingFee;      double taxiFee;      double registrationFee;      double spentTotal;      //Overall total cost      double allowedTotal;    //overall allowed cost      double mealTotal;      double total;      double allowedParking;      double allowedTaxiFee;      double hotelFee;      double nightlyRate;      double allowedHotelFee;      double hotelFeeTotal;      double allowedBreaksfastFee;      double allowedLunchFee;      double allowedDinnerFee;      double breaksfastFee;      double lunchFee;      double dinnerFee;      double allowedMealTotal;      string employeeFirstName;      string employeeLastName;      int d;      double parkingSpent;      double taxiSpent;      double spentMealTotal;            cout<<setw(20)<<"Employee Expense Report"<<endl;       cout<<setw(20)<<"________________________"<<endl<<endl;             cout<<"Employee Name: ";      cin >>employeeFirstName >>employeeLastName;      cout<<endl;              days = getDays(days);      d = static_cast<int>(days);      cout<<endl;            getTime (departureTime,arrivalTime);      cout<<endl;            cout <<"TRAVEL  "<<endl;      cout <<"--------"<<endl;      airfareFee = getAirfareAmount(airfareFee);      carRentalFee = getCarRentalAmount(carRentalFee);      getPrivateVechileExpense(privateCarFee);      allowedParking = 6.00 * days;      getParkingAmount(parkingFee, allowedParking);      taxiSpent = days * taxiFee;      allowedTaxiFee = 6.00 * days;      getTaxiAmount (taxiFee,allowedTaxiFee);      cout <<endl;      //****************************************************************************            cout <<"FEE"<<endl;      cout <<"---"<<endl;      registrationFee= getRegistrationFee(registrationFee);      allowedHotelFee = 90.00 * days;      getHotelAmount (hotelFee,allowedHotelFee);      cout<< endl;      //****************************************************************************            cout <<"MEAL"<<endl;      cout <<"----"<<endl;      allowedBreaksfastFee = 9.00 * days;      allowedLunchFee = 12.00 * days;      allowedDinnerFee = 16.00 * days;          allowedMealTotal = allowedBreaksfastFee+allowedLunchFee+allowedDinnerFee;      mealTotal= breaksfastFee +lunchFee +dinnerFee;       getMealAmount (allowedMealTotal,spentMealTotal);      cout<<endl;        //calc total    spentTotal=airfareFee+carRentalFee+privateCarFee+parkingFee+taxiFee+registrationFee+hotelFee+spentMealTotal+privateCarMilage;  allowedTotal=airfareFee+carRentalFee+privateCarFee+allowedParking+allowedTaxiFee+registrationFee+allowedHotelFee+allowedMealTotal+privateCarMilage;           //Display totals for the traveler      cout <<"Employee Expense Report for "<<employeeFirstName<<" "<<employeeLastName<<endl<<endl;      cout << "Total Days of trip: "<<days<<endl;      cout << fixed << setprecision(2);      cout << "Departure time: "<< departureTime<<setw(20)<<"Arrival time: " <<arrivalTime<<endl;       cout <<setw(8)<<setprecision(2)<<showpoint<<fixed;      cout<<endl;      cout << setw(29)<<"Spent"<<setw(20)<< "Allowed"<<endl;      cout << setw(30)<<"_________"<<setw(20)<<"_________"<<endl;      cout <<"Airfare"<<setw(20)<<airfareFee<<setw(20)<<airfareFee<<endl;      cout <<"Car Rental"<<setw(17)<<carRentalFee<<setw(20)<<carRentalFee<<endl;      cout <<"Milage"<<setw(21)<<privateCarMilage<<setw(20)<<privateCarMilage<<endl;      cout <<"Parking"<<setw(20)<<parkingFee<<setw(20)<<allowedParking<<endl;      cout <<"Taxi"<<setw(23)<<taxiFee<<setw(20)<<allowedTaxiFee<<endl;      cout <<"Registration"<<setw(15)<<registrationFee<<setw(20)<<registrationFee<<endl;      cout <<"Hotel"<<setw(22)<<hotelFeeTotal<<setw(20)<<allowedHotelFee<<endl;      cout <<"Meal"<<setw(23)<<spentMealTotal<<setw(20)<<allowedMealTotal<<endl;      cout << setw(30)<<"_________"<<setw(20)<<"_________"<<endl;      cout <<"TOTALS"<<setw(21)<<spentTotal<<setw(20)<<allowedTotal<<endl;      cout <<endl<<endl;           system ("pause");      return 0;  }//----------------------------------------------------------------------------  //Author: Jamekia Hilliard  //Function: int getDay() that asks the user how many days were spent on the trip  //Purpose: Function that asks the user how many days were spent on the trip    //Preconditions:Ask the user how many days were spent on the trip  //User enters the amount of days.  //If the number is less than zero, the error message will display The amount of days much be greater than 0  //The amount of days much be greater than 0    //-----------------------------------------------------------------------------  int getDays(int days)  {                cout << "How many days were spent on the trip?" << endl;                cin >> days;                                while (days < 1)                {                      cout << "Please enter a number greater than 1" << endl;                      cin >> days;                }                                return days;  }  //------------------------------------------------------------------------------  //Author: Jamekia Hilliard  //Function; void  getTime() that is used to ask the user the departure time and arrival time for the trip  //Purpose:Function that is used to ask the user the departure and arrive time for the trip  //Preconditions:Ask user for the departure time.  //If user does not enter a number between 00.00 and 23.59  //Then ask user for the arrival time  //If user does not enter a number between 00.00 and 23.59  //-----------------------------------------------------------------------------  void getTime (double &departureTime, double &arrivalTime)  {             cout << "At what time did you depart for the trip? (00.00 format-militray time)" ;             cin >> departureTime;             cout <<endl;                          while ( departureTime <0 || departureTime > 23.59)             {                   cout << "Error: Please enter a number between 00.00 and 23.59";                   cin >> departureTime;              }                         cout << "At what time did you arrive for the trip? (00.00 format-militray time)" ;             cin >> arrivalTime;                           while ( arrivalTime <0 || arrivalTime > 23.59)             {                   cout << "Error: Please enter a number between 00.00 and 23.59";                   cin >> arrivalTime;              }              return;          }  //--------------------------------------------------------------------------  //Function;double getAirfareAmount(double); thats used for airplane travel expenses  //Purpose: This function will be called by main to determine the amount of   //any round trip airfare for the businessperson.  //Preconditions: The function will only work given that valid data is entered.  //Postconditions:  //Author: Melissa Abbey  //-------------------------------------------------------------------------------  double getAirfareAmount (double airfareFee)  {                   cout << "What was the total cost of the air fare?" << endl;           cin >> airfareFee;           // Input validation for the aiplane travel           while (airfareFee < 0)           {                 cout << "Error: Please enter a number greater than 0. Try again!" << endl;                 cin >> airfareFee;           }                      return airfareFee;  }    //----------------------------------------------------------------------------------  //Function for car rental  //double getCarRentalAmount(double);  //Purpose: Function will calculate the amount of money spent on car rental for   //trip.  //Preconditions: Funcion only works given that valid data is entered.  //Postconditions:  //Author: Melissa Abbey  //-------------------------------------------------------------------------------------------------------  double getCarRentalAmount (double carRentalFee)  {         cout << "What was the total cost of any car rentals?" << endl;         cin >> carRentalFee;         //Input validation for the car rental amount         while (carRentalFee < 0)         {               cout << "Error:Please enter a number greater than 0. Try Again!" << endl;               cin >> carRentalFee;         }                  return carRentalFee;  }  //-------------------------------------------------------------------------------------  //Function for private vehicle usage  //double privateVehicleUse(double);  //Purpose: This function calculates the expense for miles driven using a private  // vehicle. The expense is .27 per mile driven.  //Preconditions: Function will only be used if the businessperson uses their own  // vehicle.  //Postconditions:  //Author: Melissa Abbey  //-------------------------------------------------------------------------------------  double getPrivateVechileExpense (double privateCarFee)  {         const double RATE = 0.38;         double miles;                  cout << "Were any miles driven in a private vehicle?" << endl;         cin >> miles;         //validation for private vehichle usage         while (miles < 0)         {               cout << "Error:Please enter a value greater than 0. Try again!" << endl;               cin >> miles;         }                  privateCarFee = miles * RATE;                  return privateCarFee;  }  //4$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$  //Function for parking fee totals  //double parkingFee(double, double);  //Purpose: Calculates the parking fees that the businessperson encounters. They   //are allowed up to $6 per day. The employee has to pay any excess   //amount.   //Preconditions: Function will work if valid data is entered.  //Postconditions:  //Author: Melissa Abbey  //---------------------------------------------------------------------------------  void getParkingAmount(double &parkingFee, double &allowedParking)  {      int days;                 cout << "How much was spent on parking?" << endl;         cin >> parkingFee;                  //input validation for parking fee totals         while (parkingFee < 0)         {               cout << "Error:Please enter a positive number. Try again!" << endl;               cin >> parkingFee;         }         return;  }  //2@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    //Function for total taxi fees  //Purpose:Function for company, total and, employer taxi costs  //getTaxiFee ()  //Preconditions:taxi functions. We know there is a $10 allowance per day when traveling. Anything excess of the $10 must be paid by the employee.   //Ask user the total cost of car rentals  //If its less than 0, then have the user repeat until a valid answer is entered  //Author: Kelsey Little  //--------------------------------------------------------------------------------  void getTaxiAmount (double &taxiFee, double &allowedTaxiFee)  {  int days;         cout << "How much was spent on taxi fare?" << endl;         cin >> taxiFee;                   //Input validation          while (taxiFee < 0)         {               cout << "Error: Enter a positive number. Try again!" << endl;               cin >> taxiFee;         }         return;  }    //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   //Function:double conferenceCost (double) for conference fees for the traveler.  //Purpose: To ask and calculate the cost of conference and seminar registration fees.  //Preconditions:We know that the cost have to be a positive number or more than 0.  //Ask the user for the conference cost  //Author: Kelsey Little  //-----------------------------------------------------------------------------------  double getRegistrationFee (double registrationFee)  {         cout << "How much was spent on conference fees?" << endl;         cin >> registrationFee;                  while (registrationFee < 0)         {               cout << "Error: Enter a positive number. Try again!" << endl;               cin >> registrationFee;         }                  return registrationFee;  }         /////////////////////////////////////////////////////////////////////////////////       //Function for total hotel cost  //Purpose: To calculate the hotel expenses  //Preconditions:We know the company will pay up to $90 per night. The cost can not be negative.    //Anything after $90 will be covered by the employee.  //Validate the answer with a while loop  //Then ask the user the rate of his stay. Then calculate the fee.  //double hotelFeeTotal (double)  //double hotelFee (double)  //double  allowedHotelFee(double)  //Author: Kelsey Little      //----------------------------------------------------------------------------------------------  void getHotelAmount(double &hotelFee,double &allowedHotelFee)  {      double hotelFeeTotal;      int days;      cout << "How much was spent on hotel?";      cin >> hotelFee;      cout <<endl;              while (hotelFee < 0)         {               cout << "Error: Enter a positive number. Try again!" << endl;               cin >> hotelFee;         }         hotelFeeTotal = hotelFee;           return;  }       //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  //Function for meal totals  //void meals();  //Purpose: To calculate the cost of each meal eaten.  //The cost of each meal dependent on their arrival time. It should also only ask  //for the cost of available meals. The company only allows 9 dollar allowwance for breakfast  //12 for lunch, and 16 for dinner.  //Ask the user for the cost of each available meal.  //The prices is determined by the time they eat and their departure time  //All numbers must be greater than 0. Validate the answer with a while loop.  //Author:Cleotha Tucker  //##########################################################################################  void getMealAmount(double &allowedMealTotal,double &spentMealTotal)        {int day;      int days = 0;      double breakfast;      double lunch;      double dinner;      double firstDay;      double lastDay;      double departureTime = 0;      double arrivalTime = 0;                  for(int day = 1; day <= days; day++)          {                       cout << "Day:" << day <<  endl;                    while (day < 2 && departureTime > 00.00 && departureTime<= 7.00)          {              cout << "Enter the cost of breakfast: ";              cin >> breakfast;              cout << "Enter the cost of lunch: ";              cin >> lunch;              cout << "Enter the cost of dinner: ";              cin >> dinner;          }                    while (day < 2 && departureTime > 7.01 && departureTime <=12.00)          {              cout << "Enter the cost of lunch: ";              cin >> lunch;              cout << "Enter the cost of dinner: ";              cin >> dinner;          }                while (day < 2 && departureTime > 12.01 && departureTime <=18.00)          {              cout << "Enter the cost of dinner: ";              cin >> dinner;          }      while (day > 1 && day < days )         {                  cout << "Enter the cost of breakfast: ";              cin >> breakfast;              cout << "Enter the cost of lunch: ";              cin >> lunch;              cout << "Enter the cost of dinner: ";              cin >> dinner;         }            while (day == days && arrivalTime > 8.00 && arrivalTime <= 13.00)           {              cout << "Enter the cost of breakfast: ";              cin >> breakfast;                        }                while (day == days && arrivalTime > 13.01 && arrivalTime <= 19.00)          {              cout << "Enter the cost of breakfast: ";              cin >> breakfast;              cout << "Enter the cost of lunch: ";              cin >> lunch;            }                while (day == days && arrivalTime > 19.01)          {              cout << "Enter the cost of breakfast: ";              cin >> breakfast;              cout << "Enter the cost of lunch: ";              cin >> lunch;              cout << "Enter the cost of dinner: ";              cin >> dinner;          }          cout <<endl;                return ;                }  }  
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote