Design a program to do the administration for a fun run competition. Participants can run a distance of 5 kilometers, 10 kilometers or 15 kilometers.

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
100%

Design a program to do the administration for a fun run competition. Participants can run a distance of 5 kilometers, 10 kilometers or 15 kilometers.


Ask the user if they wish to register a participant (Y or N).
Ask whether the person is a member (Y or N)
Ask the distance that the person wishes to run (5, 10, 15).

Registration fees for club members are as follows:
5km = R 65.00
10km = R 100.00
15km = R 150.00

Non-members:
For the 5 and 10 kilometers distances, the participation fees must be increased by 25%
For the 15 kilometer distance the registration fee is double that of club members.

Use the given criteria and input information to calculate the registration fee.
The program must keep track of the total number of participants per distance category, the total amount received per distance category and total amount received.
The program must also calculate the total number of participants and the total number of club members who registered.
The program must identify the category with the highest income in terms of registration
fees.

Display the following:

Total number of participants: xx

Total number of club members registered: xx

Number of participants per distance:

5 kilometers: xx   Rxxxx.xx

10 kilometers: xx   Rxxxx.xx

15 kilometers: xx   Rxxxx.xx

Total income: Rxxxx.xx

Category with highest income: xxxxxxx

EXAMPLE OF PROGRAM:

start of example

Do you wish to register a new participant? (Y or N): y
Is the participant a club member? (Y or N): n
Enter distance ( 5 / 10 / 15 ): 5

Do you wish to register a new participant? (Y or N): y
Is the participant a club member? (Y or N): n
Enter distance ( 5 / 10 / 15 ): 5

Do you wish to register a new participant? (Y or N): y
Is the participant a club member? (Y or N): y
Enter distance ( 5 / 10 / 15 ): 15

Do you wish to register a new participant? (Y or N): n

Total number of participants: 3
Total number of club members registered: 1

Total number of participants per distance:
5km:            2               R 162.50
10km:           0               R 0.00
15km:           1               R 150.00

Total Income:                   R312.50
Category with Highest Income:   5km

end of example

Expert Solution
steps

Step by step

Solved in 3 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