Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Any help for java final review hw A schools is described by a name. For full credit, follow good principles of class design and encapsulation.

Any help for java final review hw

A schools is described by a name.

For full credit, follow good principles of class design and encapsulation.

Question 1

Write the class header for the School class.

Question 2

Declare the instance data variables for the School class. A School is described by a name.

Question 3

Write two constructors:

a default constructor sets the name of the school to the empty String

a second constructor sets the name based on parameters

Question 4

Write a toString method that outputs "Name: " followed by the name of the school.

Question 5

Write appropriate getters and settters.

**In the next set of questions, write a complete class called PrivateSchool. The PrivateSchool class is a child class of the School class.

A private school is described by the name and the tuition.

Question 1

Write the class header for the PrivateSchool class.

Question 2

Declare the instance data variables for the PrivateSchool class.

A PrivateSchool is described by a name and tuition.

Question 3

Write a constructor that sets the name and tuition based on parameters

Question 4

Write a toString method that outputs "Name: " followed by the name and then then "Tuition: " followed by tuition. (You do not need to format the output of the tuition value.)

Question 5

Write appropriate getters and settters. Include validity checks when appropriate.

Question 6

Write an equals method for the PrivateSchool class.

Two private school objects are logically equivalent if they have the same name (ignoring capitalization) and the same tuition.

Question 7

Have the PrivateSchool class implement the Comparable interface.

PrivateSchool objects are ordered first by name and then by tuition (smallest to largest).

Write the new class header and the complete compareTo method.

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Be familiar with the different perspectives of service quality.

Answered: 1 week ago

Question

Describe key customer feedback collection tools.

Answered: 1 week ago

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago