The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Question:
a. Create a class team representing a sports team with 1 coach and 3 players. Use the template for team provided. The attributes of a team are: - 1 coach  - 3 players
b. Make the necessary changes in the app below to create one A????1realA????1 team and display info about the third player in the team
c. Use the classes coach  and player that are (listed here below app.java
|
public class app { public static void main(String args[]) { Â Â Â coach mycoach = new coach("Joe P.", 70); Â Â Â player x1 = new player("Todd Pinkston", 87); Â Â Â player x2 = new player("Tra Thomas", 72); Â Â Â player x3 = new player("Artis Hicks", 77); //-------------------------------------------------------------------- // create below a instance of a team with 1 coach + 3 players //-------------------------------------------------------------------- //-------------------------------------------------------------------- // Display below information about the information about the third player in the team. // And I am not taking about the players listed above (x1A????1x7) but the player that is in the class team //-------------------------------------------------------------------- Â Â Â System.out.println(______________________________________________________________); } } class coach { String name; int age; Â Â Â coach (String w_name, int w_age) { Â Â name = w_name; Â Â age = w_age; } Â Â String getInfo() { Â Â Â Â Â Â Â Â Â return("Coach name ="+ name +","+ "age = " + age); } } class player { String name; int jerseyNumber; player (String w_name, int w_jerseyNumber) { Â Â name = w_name; Â Â jerseyNumber = w_jerseyNumber; } String getInfo() { Â Â Â Â Â Â Â Â Â return ("Name=" + name +", number="+ jerseyNumber); } } |
 |
| Â |
class team
{
// I started writing the A????1constructorA????1 below which needs completion
team (Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â )
{
}
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll