Question

Create a class Team to hold data about a college sports team. The Team class holds...

Create a class Team to hold data about a college sports team. The Team class holds data fields for college name (such as Hampton College), sport (such as Soccer), and team name (such as Tigers). Include a constructor that takes parameters for each field, and get methods that return the values of the fields. Also include a public final static String named MOTTO and initialize it to Sportsmanship! Save the class in Team.java. Create a UML class diagram as well.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code


public class Team
{
public final static String MOTO="Sportsmanship!";
private String collageName,sport,teanName;

public Team(String collageName, String sport, String teanName) {
this.collageName = collageName;
this.sport = sport;
this.teanName = teanName;
}

public String getCollageName() {
return collageName;
}

public String getSport() {
return sport;
}

public String getTeanName() {
return teanName;
}
}

UML class diagram

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.

Add a comment
Know the answer?
Add Answer to:
Create a class Team to hold data about a college sports team. The Team class holds...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • c ++ Create a class Book with the data members listed below.     title, which is...

    c ++ Create a class Book with the data members listed below.     title, which is a string (initialize to empty string)     sales, which is a floating point value (as a double, initialize to 0.0) Include the following member functions:     Include a default constructor,     a constructor with parameters for each data member (in the order given above),     getters and setter methods for each data member named in camel-case. For example, if a class had a data...

  • a. Create a class named Lease with fields that hold an apartment tenant's name, apartment Number,...

    a. Create a class named Lease with fields that hold an apartment tenant's name, apartment Number, monthly rent amount, and term of the lease in months. Include a constructor that initializes the name. "XXX", the apartment number to O, the rent to 1000, and the term to 12. Also include methods to get and set each of the fields. Include a nonstatic method named addPetFee() that adds $10 to the monthly rent value and calls a static method named explainPetPolicy...

  • You are building a system to keep track of matches played by a soccer team. You...

    You are building a system to keep track of matches played by a soccer team. You need to create a class to represent your matches. Call this class Soccer Match. The class will have the following data fields and methods: • A Date data field called startTime to register the date and time for the start of the match. • A Date data field called endTime to register the date and time for the end of the match. A String...

  • java

    Create a class to hold data about a high school sports team. The Team class holds data fields for high school name (such as Roosevelt High), sport (such as Girls’ Basketball), and team name

  • Create a class named Horse that contains the following data fields: name - of type String color - of type String birthYear - of type int Include get and set methods for these fields. Next, create a...

    Create a class named Horse that contains the following data fields: name - of type String color - of type String birthYear - of type int Include get and set methods for these fields. Next, create a subclass named RaceHorse, which contains an additional field, races(of type int), that holds the number of races in which the horse has competed and additional methods to get and set the new field. DemoHorses.java public class DemoHorses { public static void main(String args[])...

  • 2. Create a class named Student that contains the following » idStudent. The idStudent is an...

    2. Create a class named Student that contains the following » idStudent. The idStudent is an int variable that holds the student's matric number. name. The name field references a String object holds the student's name. . major. The major field references a String object holds the student's major. . classification. The classification field references a String object holds the student's classification level (bongsu, kecil, muda, sulung) . Constructor should accept the student's matric number, name, major and classification as...

  • (To be written in Java code) Create a class named CollegeCourse that includes the following data...

    (To be written in Java code) Create a class named CollegeCourse that includes the following data fields: dept (String) - holds the department (for example, ENG) id (int) - the course number (for example, 101) credits (double) - the credits (for example, 3) price (double) - the fee for the course (for example, $360). All of the fields are required as arguments to the constructor, except for the fee, which is calculated at $120 per credit hour. Include a display()...

  • Create a class named Poem that contains the following fields: title - the name of the...

    Create a class named Poem that contains the following fields: title - the name of the poem (of type String) lines - the number of lines in the poem (of type int) Include a constructor that requires values for both fields. Also include get methods to retrieve field values. Create three subclasses: Couplet, Limerick, and Haiku. The constructor for each subclass requires only a title; the lines field is set using a constant value. A couplet has two lines, a...

  • Create an abstract Student class for Parker University. The class contains fields for student ID number,...

    Create an abstract Student class for Parker University. The class contains fields for student ID number, last name, and annual tuition. Include a constructor that requires parameters for the ID number and name. Include get and set methods for each field; the setTuition() method is abstract. Create three Student subclasses named UndergraduateStudent, GraduateStudent, and StudentAtLarge, each with a unique setTuition() method. Tuition for an UndergraduateStudent is $4,000 per semester, tuition for a GraduateStudent is $6,000 per semester, and tuition for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT