Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program to assist travelers in completing their travel expense claim. When you travel for business your company will reimburse you for your travel
Write a program to assist travelers in completing their travel expense claim. When you travel for business your company will reimburse you for your travel expenses. To be reimbursed, you must submit a claim that specifies the expenses incurred on each day of travel in various categories. For this program, we will have 6 categories: Airfare, Hotel, Breakfast, Lunch, Dinner, and Taxi. You can create a 2-D array to define these categories: char category[6][10] = {"Airfare", "Hotel", "Breakfast", "Lunch", "Dinner", "Taxi"}; We will assume that you can travel up to 30 days. You should create a two-dimensional array to store the expenses per day in each category. Program Requirement: Prompt the user for the actual number of days traveled. For each day, prompt the user for the expenses in each category and store the expenses in your 2-D array. Compute the total expenses per day and store that in another array variable. Compute the total expenses per category and store that in another array variable. Check to see if the sum of the total expenses per day is equal to the sum of the total expenses per category. If not, it should display: "Internal error: total daily sum does not match total category sum." This is an internal error because if you implement your program properly, the sums should be equal. These sums equal the expense claim total. Note, since you should be using float to store your costs, you cannot directly compare the two sums as there may be round-off errors when summing floating point numbers. Thus, you need to check that the two sums differ by less than some epsilon. Since we are dealing with money, a reasonable epsilon would be 0.009. Prompt the user to view various aspects of the expense claim including: expense claim total, category totals, daily totals, and expense claim details (actual expenses per day in each category). It should also offer the option to exit. Here are some sample screen shots of the program running (assuming a person is traveling for 2 days with one hotel stay). You can use your own style for the interface but the functionality should be the same
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