Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. Develop a Java program that includes the follo (a) [+4.5] A public class Player that: implements the interfaces comparable (two players are compared based

image text in transcribed
6. Develop a Java program that includes the follo (a) [+4.5] A public class Player that: implements the interfaces comparable (two players are compared based on their performances). - has two private instance variables, string between 0 any name value is acceptable) and int performance (must be an inter formance. 0 and 100 inclusive). - has setter methods for name and (marks will be deducted if you include getters) - has a two-argument constructor to set the name and per formance to given values. - overrides the Objeot's tostring () mame: "Nohn order to return a string consisting of a player's name and performance; for example, "Name: John, Perfromance: 73 ". (b) [+2.5] A public class ForeignPlayer that: extends Player class. - has a private instance variable, string country 2. - has a private instance variabie, has a three-argument constructor to set name, per formance, and country to given values. performance, and country; for example, "Name: Omar, Peformance:74, Country: Egypt". (c) [+3] A public class Team that has: Assume any order of the players and any values for the players' attributes. 17513 - a method void print Foreignplayers () that prints only the foreign players in team. The players should be printed in an ascending order based on their performance. Your method should work when the team has any number of players in any order. The order of the items in team should remain the same after calling printForeignplayer. A sample output of calling this method is: OmarHuangPerformance:74Country:EgyptPerformance:77Country:China

Step by Step Solution

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

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

4. Label problematic uses of language and their remedies

Answered: 1 week ago