Question: Read this exercise carefully and take your time to work out the logic. Your chapter 1 0 folder contains versions of rome - report.html and

Read this exercise carefully and take your time to work out the logic. Your chapter10 folder contains versions of rome-report.html and rome-report.php as well as a text file named travel.dat which contains a list of travel reservations. Each line in the travel.dat file contains a single reservation: the name of a destination, number of people traveling, and number of nights staying, for example:
Rome:2:12
Tokyo:3:15
The program should read the file and report the number of reservations in the file for Rome, and the total number of people traveling to Rome. For testing purposes, the correct number of reservations for Rome is 7 and the correct number of people traveling to Rome is 18(but your code should still work correctly if you change the data in the file). Note that the data file is named travel.dat and not travel.txt.
Not sure what to do? Use your text editor to open travel.dat. Now take a piece of paper and pencil, and solve the problem as if you are the rome-report.php program. Each time you read a line from the file and identify the destination, number of people traveling, and number of nights staying, how are
you deciding whether or not to increase the count of Rome reservations, and the total of the number of people traveling to Rome, and what amount are you adding to the count of Rome reservations and the total number of Rome travelers? Now consider how to follow the same procedure in your code. HINT: Review the process-wages5 example in the chapter. Although that code is designed to calculate a average you will see that it uses a similar procedure to the one you will need to develop for this exercise.
travel.dat
Rome:2:12
Tokyo:3:15
Rome:1:14
Santiago:1:7
Cairo:2:10
Cairo:5:7
Barcelona:2:10
Rome:3:12
Santiago:3:7
Cairo:3:10
Rome:2:14
Rome:4:8
Barcelona:4:12
Tokyo:2:14
Cairo:2:12
Rome:4:12
Barcelona:3:8
Tokyo:2:10
Rome:2:12
Cairo:5:8
Read this exercise carefully and take your time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!