Answered step by step
Verified Expert Solution
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 per mile.
Parking fees. The company allows up to $ per day. Anything in excess of this must be paid by the employee.
Taxi fees. The company allows up to $ 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 $ per night for lodging. Anything in excess of this amount must be paid by the employee.
Group discount on Hotel Fare: A group of gets gets ; gets and above persons eets
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 Lunch is allowed if the time of departure is before noon. Dinner is allowed if the time of departure is before On the last day of the trip, breakfast is allowed if the time of arrival is after Lunch is allowed if the time of arrival is after Dinner is allowed if the time of arrival is after The program should only ask for the costs of allowable meals. The company allows up to $ for breakfast, $ for lunch, and $ 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 and that the time of deporture and the time of arrivol are voild.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started