Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Travel Expenses Write a program that calculates and displays the total travel expenses of a businessperson on a trip. The program should have functions that

Travel Expenses
Write a program that calculates and displays the total travel expenses of a businessperson on a trip. The program should have functions that ask for and return the following:
The total number of days spent on the trip
The time of 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
Miles driven, if a private vehide was used. Vehicle allowance is 50.58 per mile.
Parking fees. (The company allows up to $12 per day. Anything in excess of this must be paid by the employee.)
Taxi fees. The company allows up to $40 per day for each day a taxi was used. Anything in excess of this must be paid by the employee.)
Conference or seminar registration fees
Hotel expenses. (The company allows up to $90 per night for lodging. Anything in excess of this amount must be paid by the employee.)
Group discount on Hotel Fare: A group of 5-9 gets 10%,10-15 gets 15%;16-20 gets 20%, and above 20 persons eets 25%
The cost of each meal eaten On the first day of the trip, breaifast is allowed as an expense if the time of departure is before 7am. Lunch is allowed if the time of departure is before noon. Dinner is allowed if the time of departure is before 6p.m. On the last day of the trip, breakfast is allowed if the time of arrival is after 8a.m. Lunch is allowed if the time of arrival is after 1p.m. Dinner is allowed if the time of arrival is after 7p.m. The program should only ask for the costs of allowable meals. (The company allows up to $18 for breakfast, $12 for lunch, and $20 for dinner. Anything in excess of this must be paid by the employee.)
The program should perform the necessary calculations to determine the total amount spent by the business traveler in each category (mileage charges, parking, hotel, meals, etc.) as well as the maximum amount allowed in each category, it should then createla nicely formatted expense report that indudes the amount spent and the amount allowed in each category, as well as the total amount spent, and total amount allowied for the entire trip. This report should be written to a file.
Input Validation: The program should not occept negative numbers for any dollar amount or for miles driven in a private vehicle it should also ensure that the number af doys is ot least 1 and that the time of deporture and the time of arrivol are voild.
image text in transcribed

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

Visualizing Health And Healthcare Data Creating Clear And Compelling Visualizations To See How Youre Doing

Authors: Katherine Rowell ,Lindsay Betzendahl ,Cambria Brown

1st Edition

1119680883, 978-1119680888

More Books

Students also viewed these Databases questions