Problem1: FILE HANDLING PROGRAM. Marah Land Theme Park wants you to create a ticketing system for their establishment. They also want to monitor the visitors coming to the park. You are tasked to create a program that will read the visitor information in an input file called “input.txt”. The input file contains the following information: Harith Al Rashdy Muscat 5 2 3 The descriptions of the file content are displayed below: Line Number Description 1 Name of the Guest 2 Place of Visitor 3 Number of visitors 4 Number of Adults 5 Number of Children The ticket fee for adult 6 OMR/person and Child 3.5 OMR/Child The service charge rate has a fixed value of 0.600 Baisa for both adult and child You are tasked to do the following: 1. Create a function that will read the input file and will display all the file contents in your screen. 2. Create a function that will compute the total fee. The total fee is computed by multiplying the number of adult visitors and their ticket fee + multiplying the number of child visitors and their ticket fee. 3. Create a function that will compute the service charge. The service charge is computed as total fee multiplied to service charge rate. 4. Create a function that will compute for the discount. The discount is given based on the visitor’s place. If the visitors are from “Muscat”, discount is computed as 2% of the total fee, otherwise it is computed as 3.5% of the total fee. 5. Create a function that will compute for the total bill. The total bill is computed as total fee plus service charge minus the discount. 6. Call all your functions in the main program and write the computed values: total fee, service charge, discount, and total bill into the file “ouput.txt”.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Problem1: FILE HANDLING PROGRAM.
Marah Land Theme Park wants you to create a ticketing system for their establishment. They also want to monitor the visitors coming
to the park. You are tasked to create a program that will read the visitor information in an input file called “input.txt”. The input file
contains the following information:
Harith Al Rashdy
Muscat
5
2
3
The descriptions of the file content are displayed below:
Line Number Description
1 Name of the Guest
2 Place of Visitor
3 Number of visitors
4 Number of Adults
5 Number of Children
The ticket fee for adult 6 OMR/person and Child 3.5 OMR/Child
The service charge rate has a fixed value of 0.600 Baisa for both adult and child
You are tasked to do the following:
1. Create a function that will read the input file and will display all the file contents in your screen.
2. Create a function that will compute the total fee. The total fee is computed by multiplying the number of adult visitors and their
ticket fee + multiplying the number of child visitors and their ticket fee.
3. Create a function that will compute the service charge. The service charge is computed as total fee multiplied to service charge
rate.
4. Create a function that will compute for the discount. The discount is given based on the visitor’s place. If the visitors are from
“Muscat”, discount is computed as 2% of the total fee, otherwise it is computed as 3.5% of the total fee.
5. Create a function that will compute for the total bill. The total bill is computed as total fee plus service charge minus the discount.
6. Call all your functions in the main program and write the computed values: total fee, service charge, discount, and total bill into
the file “ouput.txt”.

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY