Question: JAVA Task 1: Design a class called Movie that has the following private fields: serial: int title: String genre: String rent_fee: double 1. The Movie

JAVA

Task 1: Design a class called Movie that has the following private fields:

serial: int

title: String

genre: String

rent_fee: double

1. The Movie class should have the following constructors:

Full-argument constructor

No-argument constructor

Copy constructor

2. Provide setter and getter methods for each field

3. Override the toString() method to return a String with the following format:

Movie(345, Titanic, Romance, 25.5 SAR per day)

Assuming that the object fields were initialized to 345TitanicRomance, and 25.5

4. Override the equals() method to return true if the Movie objects have the same title and false otherwise.

Task 2: Write a test class called TestMovie where you will create 3 Movie objects using the 3 constructors.

1. Use the following arguments to call the full-argument constructor:

345TitanicRomance, and 25.5

2. Set the rent fee of the first Movie object to 15.5.

3. Print the content of the first and third objects.

4. Check if the first and second objects are equal

Step by Step Solution

3.36 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

creating the movie class class Movie variables private int serial private String title genre private ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!