Slide Type Slide • Exercise # 4 A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: • The name of the client, the service sold (such as Dinner,...


Slide Type Slide<br>• Exercise # 4 A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons:<br>• The name of the client, the service sold (such as Dinner, Conference, Lodging, and so on),<br>• The amount of the sale, and the date of that event.<br>• Write a program that reads such a file and displays the total amount for each service category. Display an error if the file does not exit or the format of the<br>record is incorrect. No need to display anything else in this regard. Note that you can assume that the dates are entered correctly (no need to validate<br>them). You may also assume that the name of the input text file is inputex4.txt.<br>• Make sure you use a dictionary in your solution.<br>• Sample run is included below for the given input file inputex4.txt<br>Summary of total sales according to services<br>Dinner<br>634.75<br>Conference<br>1133.25<br>Lodging<br>Dinner and Lodging<br>550.25<br>625.14<br>Slide Tyne Fragment v<br>

Extracted text: Slide Type Slide • Exercise # 4 A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: • The name of the client, the service sold (such as Dinner, Conference, Lodging, and so on), • The amount of the sale, and the date of that event. • Write a program that reads such a file and displays the total amount for each service category. Display an error if the file does not exit or the format of the record is incorrect. No need to display anything else in this regard. Note that you can assume that the dates are entered correctly (no need to validate them). You may also assume that the name of the input text file is inputex4.txt. • Make sure you use a dictionary in your solution. • Sample run is included below for the given input file inputex4.txt Summary of total sales according to services Dinner 634.75 Conference 1133.25 Lodging Dinner and Lodging 550.25 625.14 Slide Tyne Fragment v

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here