Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pakistan Cricket Board (PCB) is looking for a solution to record the information about their different types of players. Under the contract of PCB there

Pakistan Cricket Board (PCB) is looking for a solution to record the information about their different types of players. Under the contract of PCB there are three (3) different type of players. Suppose you are asked to develop a system, which input all the data of player and calculate & print the total scores and income of a cricket player of Pakistan cricket team. Each player is identified by name, CNIC, income and score. There are three types of players – Test, OneDay, T20. A player can be in all types but If player is not playing in any one or more types then you will input zero(0) for the data members of that class. Each type of Player gets paid using a different formula. OneDay Players are paid by their Monthly fixed salary of Rs.100,000/- per month, test players are paid by the number of hours they played at rate of Rs.2000/- per hour, while T20 players are being played by the number of matches they have played at the rate of 50000/- per match.

Keeping in mind the above scenario,

1. Write the complete states and behaviors of child and parent classes

2. Write the constructor for each class.

3. Apply method overriding in child classes.

4. Exercise the main function to test these classes.

Here is one of the Example Output if player is not playing T20:

Enter Player Name:Shahid_Afridi

Enter CNIC:12345-6783765-1

Enter Test Hrs:20

Enter Score in Test:10000

Enter salary_per_month:3

Enter Score in OneDay:5000

Enter no_of_matches in T20:0

Enter Score in T20:0

Player Records Added by Your Registration Number

------------------------------------------------

Player Name: Shahid_Afridi

Player CNIC: 12345-6783765-1

Total Score is:15000

Total Incmoe is:340000

Step by Step Solution

3.46 Rating (149 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Horngrens Cost Accounting A Managerial Emphasis

Authors: Srikant M. Datar, Madhav V. Rajan

16th edition

134475585, 978-0134475998, 134475992, 978-0134475585

More Books

Students also viewed these Programming questions

Question

Find f. f(x) = f'(x) = 12x + X x > 0, f(1) = -4

Answered: 1 week ago

Question

How did qualitative research methods emerge in psychology?

Answered: 1 week ago

Question

If 2 5 9 - k 5 8 = 2 5 8 , what is the value of k?

Answered: 1 week ago

Question

=+a. Draw a diagram of this RAID system.

Answered: 1 week ago

Question

=+b. Calculate the reliability at t 5 800,000 cycles.

Answered: 1 week ago