Geumga Bowling Centre giving a special rate for their customer as shown in Table 1: Table 1: Table for rate per game. Rate per game Members Non members RM4.50 per game RM7.50 per game Age below 20 RM6.00 per game Age 20 & above RM10.00 per game Write a C++ program to calculate and display the total rate based on the special rate given. However, your program MUST written by using two user-define functions. The details function you must create are as follow, calcBelow20: This function should calculate the totalRate for members or non members (below 20) and then return the totalRate as float. calcAbove20: This function should calculate the totalRate for members or non members (20 and above) and then return the totalRate as float.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Example of your program output is shown in Figure Q2.
FIGURE Q2: OUTPUT CONSOLE
I confirm that this LAB TEST is my own work,
Is not copied from any other person's work.
Name : VINCENZO BIN CASSANO
Matrix Number : B091910187
WELCOME TO GEUMGA BOWLING CENTER.
Your age = 23 [Enter]
Have membership (y/n): y [Enter]
Total game = 3 [Enter]
Your total rate is RM 13.50
FIGURE Q2: OUTPUT CONSOLE
I confirm that this LAB TEST is my own work,
Is not copied from any other person's work.
Name : VINCENZO BIN CASSANO
Matrix Number : B091910187
WELCOME TO GEUMGA BOWLING CENTER.
Your age = 45 [Enter]
Have membership (y/n): n [Enter]
Total game = 2 [Enter]
Your total rate is RM 20.00
Figure 2: Output Sample
Transcribed Image Text:Example of your program output is shown in Figure Q2. FIGURE Q2: OUTPUT CONSOLE I confirm that this LAB TEST is my own work, Is not copied from any other person's work. Name : VINCENZO BIN CASSANO Matrix Number : B091910187 WELCOME TO GEUMGA BOWLING CENTER. Your age = 23 [Enter] Have membership (y/n): y [Enter] Total game = 3 [Enter] Your total rate is RM 13.50 FIGURE Q2: OUTPUT CONSOLE I confirm that this LAB TEST is my own work, Is not copied from any other person's work. Name : VINCENZO BIN CASSANO Matrix Number : B091910187 WELCOME TO GEUMGA BOWLING CENTER. Your age = 45 [Enter] Have membership (y/n): n [Enter] Total game = 2 [Enter] Your total rate is RM 20.00 Figure 2: Output Sample
QUESTION 1
Geumga Bowling Centre giving a special rate for their customer as shown in Table 1:
Table 1: Table for rate per game.
Rate per game
Non members
RM6.00 per game
Members
Age below 20
RM4.50 per game
Age 20 & above
RM7.50 per game
RM10.00 per game
Write a C++ program to calculate and display the total rate based on the special rate given.
However, your program MUST written by using two user-define functions. The details function
you must create are as follow,
calcBelow20: This function should calculate the totalRate for members or non
members (below 20) and then return the totalRate as float.
calcAbove20: This function should calculate the totalRate for members or non
members (20 and above) and then return the totalRate as float.
Figure 1 shows flowchart for the main function.
Main Function Flowchart:
Start
Read age, members,
totalGames
No
Yes
a ge>= 20
TotaRate =
TotaRate =
calcBelow20
calcAbove20
Display TotaRate
End
Figure 1: Main function
Transcribed Image Text:QUESTION 1 Geumga Bowling Centre giving a special rate for their customer as shown in Table 1: Table 1: Table for rate per game. Rate per game Non members RM6.00 per game Members Age below 20 RM4.50 per game Age 20 & above RM7.50 per game RM10.00 per game Write a C++ program to calculate and display the total rate based on the special rate given. However, your program MUST written by using two user-define functions. The details function you must create are as follow, calcBelow20: This function should calculate the totalRate for members or non members (below 20) and then return the totalRate as float. calcAbove20: This function should calculate the totalRate for members or non members (20 and above) and then return the totalRate as float. Figure 1 shows flowchart for the main function. Main Function Flowchart: Start Read age, members, totalGames No Yes a ge>= 20 TotaRate = TotaRate = calcBelow20 calcAbove20 Display TotaRate End Figure 1: Main function
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education