Question: Implementation requirements on last screenshot. Using C++ Problem statement Business trip is part of the enterprise culture. Suppose a businessperson just completed a business trip

Implementation requirements on last screenshot. Using C++

Implementation requirements on last screenshot. Using C++ Problem statement Business trip is

part of the enterprise culture. Suppose a businessperson just completed a business

trip for your company. Now, you are tasked to write a program

that calculates and displays the total travel expenses, allowable expenses (reimbursement), and

the excess that must be paid by the businessperson, if any. The

Problem statement Business trip is part of the enterprise culture. Suppose a businessperson just completed a business trip for your company. Now, you are tasked to write a program that calculates and displays the total travel expenses, allowable expenses (reimbursement), and the excess that must be paid by the businessperson, if any. The program should prompt the user for the following: The number of days spent on the trip The departure time on the first day of the trip The arrival time on the last day of the trip The amount of airfare Conference (or seminar) fees Transportation expenses: Rent a car or use taxis during the trip If rent a car: Total rental fee, including gas fee o Parking fees each day If use taxis: i fees each day, if use taxis Hotel expenses each day, if number of days spent on the trip is greater than 1 The total travel expenses and reimbursement can be calculated as follows: Both airfare and conference (or seminar) fees can be reimbursed For transportation expenses, if rent a car, the total rental fee, including gas fee, can be reimbursed. If rent a car, the company allows to reimburse up to $6 for parking per day (cannot carry over). Anything beyond this must be paid by the businessperson. If a taxi was used during the trip, the company allows to reimburse up to $10 per day (cannot carry over). Anything beyond this must be paid by the businessperson. The company allows up to $90 per night for hotel expense (cannot carry over). Anything beyond this must be paid by the businessperson. The amount of each meal eaten. On the first day of the trip, a meal is allowed as an expense if the time of departure is BEFORE (and including)... Meal type Departure time Breakfast Lunch 6 pm 7 am 12 noon Dinner For example, if departure time is 6 am, all 3 meals on the first day can be reimbursed, if departure time is 9 am, only lunch and dinner on the first day can be reimbursed. On the last day of the trip, a meal is allowed as an expense if the time of arrival is AFTER (and including)... Meal type Arrival time Breakfast Lunch Dinner 8 am 1 pm 7 pm For example, if arrival time is 7 am, all 3 meals on the last day are NOT reimbursed, if arrival time is 5 pm, only breakfast and lunch on the last day can be reimbursed. The company allows to reimburse up to $9 for breakfast, $12 for lunch, and $16 for dinner cannot carry over). Anything beyond this must be paid by the businessperson. Reimbursement rule for the company: If a payment goes beyond the maximal allowable amount for a certain item, the businessperson gets the maximal allowable amount reimbursed, otherwise, the businessperson gets how much he or she paid reimbursed. For example, if the businessperson spent $120 for the hotel first night and $70 for the second night, and spent $10 for the dinner first night and $20 for the second (both meals are allowed to reimburse), then the allowable expenses for these two items are 90 + 70 + 10 + 16 = 186. The rest ((120-90) + (20-16) = $34) will be paid by the businessperson himself/herself Example run (user inputs are highlighted): Enter the number of days on your trip: abb Invalid input! Enter again: 3 Enter your departure time (just the hour) on the first day in 24-hour format (i.e., 16 for 4pm): 8 Enter your arrival time (just the hour) on the last day in 24-hour format (i.e., 16 for 4pm): 17 Enter total amount of airfare, in $: 586.53 Enter total conference or seminar fees, in $: 26.50 Did you 1: rent a car or 2use taxi during your trip? Enter 1 or 2: 1 Enter your total car rental fee, including gas fee, in $ 120.63 Enter parking fee for day 1, in $: 3.6 Enter parking fee for day 2, in $: 12 Enter parking fee for day 3, in $: 5.8 Enter hotel fee for night 1, in $: 100.34 Enter hotel fee for night 2, in $: 88.63 Day 1, Your breakfast for day 1 is not allowed for reimbursement. Enter lunch fee, in $: 12.10 Enter dinner fee, in $: 18.69 Day 2 Enter breakfast fee, in $: 10.77 Enter lunch fee, in $: 8.50 Enter dinner fee, in $: 12.18 Day 3, Enter breakfast fee, in $: 4.36 Enter lunch fee, in $: 16.81 Your dinner for day 3 is not allowed for reimbursement. Your total expense for this trip is: $1027.44 Your total reimbursement for this trip is: $1001.73 You need to pay: $25.71 Do you want to play again (O-no or 1-yes)? O Side notes for the calculations in the example run (you don't need to include this in your program output): Total expense: 586.53 (airfare) + 26.5 (conference) + 120.63 (rental) + (3.6 + 12 + 5.8) (parking) + (100.34 + 88.63) (hotel) + (12.1 + 18.69) (day 1 meals) + (10.77 + 8.5 + 12.18) (day 2 meals) + (4.36 + 16.81) (day 3 meals) = 1027.44 Total reimbursement: 586.53 (airfare) + 26.5 (conference) + 120.63 (rental) + (3.6 + 6 + 5.8) (parking) + (90 + 88.63) (hotel) + (12 + 16) (day 1 meals) + (9 + 8.5 + 12.18) (day 2 meals) + (4.36 + 12) (day 3 meals) = 1001.73 The excess: 1027.44 - 1001.73 = 25.71 Program Code - Due Sunday 2/14/21, 11:59pm on TEACH Implementation Requirements: Must produce a working program that follows each rule stated above. Your user interface must provide clear instructions for the user and information about the data being presented. The program should never end until the user tells you to. The program must involve the following functions (with exact prototypes): void update_total (double stotal_expense, double &total_reimbursement, double expense_to_add, double reimbursement_to_add); //update total_expense and total_reimbursement void meal_fee (int days_of_trip, double departure_time, double arrival_time, double &meal expense, double Smeal_reimbursement); //calculate the total meal expense and reimbursement fee All functions need to be under 20 lines. Whitespace, single curly braces, variable declarations, and the function header do not count. Functions over 20 lines need justification in comments. Do not put multiple statements into one line. Error checking: Re-prompt user for any bad inputs (includes other data types). o Do not accept negative numbers for any dollar amount. o Do not accept number less than 1 for the number of days. o Only accept valid times for the time of departure and the time of arrival. No global variables allowed (those declared outside of many or any other function), global constants are allowed. goto function is NOT allowed. Allowed built-in functions: atoi), atof(), is_digit(), itoa() (Update: double check with the instructor and/or the TAs before using a built-in function that you have not seen it in class) Libraries that are not introduced in class are not allowed to use. (Update: specifically, , , ) Make sure you follow the style guidelines, have a program and function headers with appropriate comments, and be consistent. Update: The use of array is not allowed in this assignment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!