Click here to Skip to main content
15,309,768 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
The Australian cricket team is the best team in the world. The Australian Cricket Board that handles the payment related issues of the players has decided to develop software that would automatically
Calculates the income of the players based on their grade, the number of matches each player plays, and their performance in the tournament.
Create an application using inheritance and polymorphism to implement the software. The application should consist of the following files:
1. Game.java
2. TestMatch.java
3. WorldCup.java
4. Player.java
5. PlayerTest.java
Each file has a specific purpose and functionality. The descriptions of each file are as follows:
Game.java
The Game class is an abstract base class that provides abstract method named
• double calculateIncome(String numGames) to calculate the income of the player and
• double calculateBonus(String performance, String grade) to calculate the bonus based on their performance in a match and the grade. The performance is rated as good, average, and best.
TestMatch.java
The TestMatch class inherits the Game class and overrides the methods to calculate the income and grade based on the test matches played by the player.
WorldCup.java
The WorldCup class inherits the Game class and overrides the methods to calculate the income and grade based on the number of world cup matches played by the player.
Player.java
The Player class contains instance variables to stores the details of the player such as name, age, gender, and so on and a method
• displayDetails(String match) to display the details of the player. The displayDetails(String match) method invokes the calculateIncome() and calculateBonus() methods of the TestMatch or WorldCup classes based on the type of match specified by the user, that is, Test Match or World Cup.
PlayerTest.java
The PlayerTest class creates an instance of the Player class and passes the appropriate arguments to the constructor. Also, the class displays the details of the player such as personal details, income, and bonus by invoking the displayDetails() method using the Player class object.

What I have tried:

i cant understand scenerio type questions
Posted
Updated 3-Jan-22 4:21am
v2
Comments
PIEBALDconsult 3-Jan-22 10:02am
   
We won't do your homework for you.
Patrice T 3-Jan-22 10:27am
   
You need to talk to your teacher.
There is no way we teach you this.

1 solution

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]

Take the question carefully, and look at it bit by bit. If you still don't understand the question, you need to discuss that with your tutor.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900