C++ Create a program that fulfills the requirements of the following prompt This
ID: 3592636 • Letter: C
Question
C++
Create a program that fulfills the requirements of the following prompt This program will create an expense report for an employee's business trip. The program will ask the user for their name, the date the trip first started, the date the trip ended, and hovw many days the trip lasted For each day, the program will ask for the following Cost of airfare (for that day) Cost of a rental car (for that day) . How many miles were driven per day (Assume a cost of 0.27 per mile for fuel) * Cost of food for three meals per day (Up to S20 per meal per day) o Ask for breakfast, lunch, and dinner separately Cost of other miscellaneous expenses per day (Up to $30 per day) Each day's expenses should be added up for a total cost of expenses for each day. Additionally, the program should calculate the total expense of the trip, once all expenses have been inputted Your program MUST contain: . At least one loop At least one function (besides your main) function) Input validation for each user input o Remember, costs should not be negative. Costs can be zero An output file named "Expense Report.txt" containing the expense information for each day and the total expense for the trip, formatted like the example on the next page I am looking for these main elements in your program as a basis of grading it * Your program compiles and runs without errors * Your programming style is easily readable, including indentation and naming conventions How you split up your program through functions and loops . Your program and output are professional, including proper * You have named your file . Include a commented header stating your name and that this spelling, formatting, and neatness "LastnameFirstnameMidterm.cpp". is your midterm. I will take points off if this isn't at the top of your .cppExplanation / Answer
#include #include 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() { 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; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.