ASU ACME Tour Company C++ Code

ACME Tour Company offers tours to various locations; all tours include a tour guide. Write a program for the company which will allow tour guides to input the data from their trips. The program should implement the do-while control structure for the overall control of the program and for input validation. Each tour guide’s data should consist of the following:

employee ID number

number of days of the tour

  • dollar amount for each day (total of meals, tips, entry fees, transportation, etc)
  • dollar amount for each night’s accommodations
  • The program should then repeat the process if there is more data to be entered.
  • This data should be added to the spHWtourGuidesData.txt file which is provided with this assignment. Each tour guide’s data should be on a single line with a space separating each piece of data. The data should be stored in the file in the order listed above. The file write position should be remain on the line after storing the last piece of data; there should be no whitespace following the last piece of data.

When accepting a tour guide’s data, do not accept invalid data. An employee ID must be between 1001 and 9999. The shortest tour is 6 days, while the longest tour is 92 days. All dollar amounts should be non-negative and should be stored with two decimal places. There will be a dollar amount for each day of the tour; some daily totals may be $0.00 as there may be a free day built into the tour. There will be one less night than the total days of the tour; some accommodation costs may be $0.00 as transportation may include overnight lodging. Do not include commas in any number.

The program should then repeat the entire process if there is more data to be entered; the user should be queried about adding more data.

After all the data is added by the user, the program should read all the data in the file spHWtourGuidesData.txt and display a report to the screen. See the screen shot to see the required formatting and data that should be included in the report. Include commas in the formatting of all the numbers in the report.

To get the values printed with commas, include the locale library and use the following statement prior to displaying any numbers that should have commas:

cout.imbue(std::locale(“en_US.utf-8”));

spHWtourGuidesData.txt prior to running program

1001 6 35.56 15.25 69.34 152.35 0.00 65.35 125.65 250.35 0.00 412.36 321.24
9999 10 0.00 12.50 0.00 65.75 95.35 34.53 0.00 0.00 125.68 0.00 138.25 156.35 0.00 358.25 423.52 115.35 0.00 0.00 142.35
5521 8 25.65 159.35 125.35 1265.35 124.35 456.35 458.35 123.00 125.36 345.57 310.25 2500.00 365.35 1452.00 1520.00
4563 6 0.00 0.00 0.00 0.00 0.00 0.00 125.00 356.35 356.36 356.36 356.36

The output of your program should look exactly like this. Data values may differ.

Enter employee ID number (1001 – 9999): 999
Enter employee ID number (1001 – 9999): 10001
Enter employee ID number (1001 – 9999): 1234

Enter length of tour (6 – 92): 5
Enter length of tour (6 – 92): 100
Enter length of tour (6 – 92): 7

Enter expenses (0.00 or more) for day 1: -8.15
Enter expenses (0.00 or more) for day 1: 98.15
Enter expenses (0.00 or more) for day 2: 150.25
Enter expenses (0.00 or more) for day 3: 52.35
Enter expenses (0.00 or more) for day 4: 65.51
Enter expenses (0.00 or more) for day 5: 126.40
Enter expenses (0.00 or more) for day 6: 45.23
Enter expenses (0.00 or more) for day 7: 0

Enter accommodation expense (0.00 or more) for night 1: -12.50
Enter accommodation expense (0.00 or more) for night 1: 120.52
Enter accommodation expense (0.00 or more) for night 2: 0
Enter accommodation expense (0.00 or more) for night 3: 156.37
Enter accommodation expense (0.00 or more) for night 4: 156.37
Enter accommodation expense (0.00 or more) for night 5: 250.14
Enter accommodation expense (0.00 or more) for night 6: 325.67

Is there more data to add (Y or N)? j
Is there more data to add (Y or N)? n

Employee Tour Daily Accommodation Total
ID Number Length Expenses Expenses Expenses
——————————————————–
1,001 6 337.85 1,109.60 1,447.45
9,999 10 333.81 1,334.07 1,667.88
5,521 8 2,737.75 6,618.53 9,356.28
4,563 6 0.00 1,550.43 1,550.43
1,234 7 537.89 1,009.07 1,546.96
============
15,569.00

spHWtourGuidesData.txt after running the program for screenshot posted above

1001 6 35.56 15.25 69.34 152.35 0.00 65.35 125.65 250.35 0.00 412.36 321.24
9999 10 0.00 12.50 0.00 65.75 95.35 34.53 0.00 0.00 125.68 0.00 138.25 156.35 0.00 358.25 423.52 115.35 0.00 0.00 142.35
5521 8 25.65 159.35 125.35 1265.35 124.35 456.35 458.35 123.00 125.36 345.57 310.25 2500.00 365.35 1452.00 1520.00
4563 6 0.00 0.00 0.00 0.00 0.00 0.00 125.00 356.35 356.36 356.36 356.36
1234 7 98.15 150.25 52.35 65.51 126.40 45.23 0.00 120.52 0.00 156.37 156.37 250.14 325.67

When you have completed and tested the program, submit the source code by using the course submission utility.

Spend enough time with pencil and paper to satisfy yourself that you truly understand the problem and can work examples by hand before starting to write program code; you cannot explain a solution to a computer if you do not understand it yourself. If you find you do not understand a problem well enough to work examples by hand, seek out input from your instructor or fellow classmates; discussion with classmates can be particularly rewarding for both parties (as long as collaboration stops here). Start as early as you can to give yourself every opportunity to think through a solution; starting close to the deadline increases pressure on you and can make it even harder to think.

need 

1. C++ code 

2.Test Cases**

Note: Avoid Turnitin and plagiarism-detection software**

Don't hesitate - Save time and Excel

Are you overwhelmed by an intense schedule and facing difficulties completing this assignment? We at GrandHomework know how to assist students in the most effective and cheap way possible. To be sure of this, place an order and enjoy the best grades that you deserve!

Post Homework
Top