Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a complete design using C + + (including understanding issues, flowcharts, and program tests) and program code Problem statement Creating business trip expense reports

image text in transcribedimage text in transcribedimage text in transcribed

Write a complete design using C + + (including understanding issues, flowcharts, and program tests) and program code

Problem statement Creating business trip expense reports is common practice. Suppose a businessperson just completed a business trip for your company. Now, you are tasked to write a program that calculates the total travel reimbursement to the businessperson and the actual amount they spent. 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, and arrival time on the last day of the trip The amount of airfare . . .Conference or seminar registration fees . Rent a car or use taxis during the trip o If car rented, then you must prompt for the rental car type, total rental fee, total gas fee, total miles driven, and parking fees for each day o If a taxi was taken, then calculate taxi fees for each day Hotel expenses for each day, if number of days spent on the trip is greater than1 . The total travel expenses and reimbursement are calculated as follows Both airfare and registration fees can be reimbursed . If a car was rented, the maximum reimbursement expense for each car type and gas fee r mile are listed in the following table Car type Maximum allowed Rental fee per day ($ 20 25 30 50 Maximum allowed Gas fee Sedan SUV Van Convertible r mile driven ($ 0.24 0.27 0.32 0.45 The total expense for the car is: total rental fee total gas fee The maximum reimbursement for the car is: max allowed rental fee per day for a car type number of days of the trip + max allowed gas fee per mile* total miles driven If a car was rented, the company allows up to $6 for parking per day. Anything beyond this must be paid by the busines If a taxi was used anytime during the trip, the company allows up to $10 per day Anything beyond this must be paid by the businessperson The company allows up to $90 per night for hotel expense. 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 includin . sperson . . . Meal Breakfast Lunch Dinner Departure time 7 am noon 6 For example, if departure time is 6:30 am, all 3 meals on the first day are reimbursed, if departure time is 9 am, only lunch and dinner on the first day are reimbursed On the last day of the trip, a meal is allowed as an expense if the time of arrival is AFTER and includin Meal Breakfast Lunch Dinner Arrival time 8 am For example, if arrival time is 7:30 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 are reimbursed The company allows up to $9 for breakfast, $12 for lunch, and $16 for dinner. Anything beyond this must be paid by the employee . 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 Example run Enter the number of days on your trip: abb Invalid input! Enter again: 3 Enter your departure time on the first day: 8.00 Enter your arrival time on the last day: 17.30 Enter total amount of airfare, in $: 586.53 Entertotal conference or seminar registration fees, in S: 26.50 Did you 1: rent a car or 2: use taxi for your trip? Enter 1 or 2: 1 Enter total spent on the rental car in $: 150.00 Enter your total gas fee spent in $: 25.64 1. Sedan 2. SUV 3. Van 4. Convertible Enter Enter the total miles driven, in miles: 130 your rental car type: 2 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 S: 100.34 Enter hotel fee for night 2, in S: 88.63 Day 1 Your breakfast for day 1 is not allowed as an expense 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 as an expense Your total expense for this trip is: $1082.45 Your total reimbursement for this trip is: $981.74 Do you want to calculate another business expense report (0-no or 1-yes)? 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions