Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

creating the movie class class Movie variables private int serial private String title genre private ... 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

Java An Introduction To Problem Solving And Programming

Authors: Walter Savitch

8th Edition

0134462033, 978-0134462035

More Books

Students also viewed these Computer Network questions

Question

Establish identity. cos( + k) = (-1)k cos , k any integer

Answered: 1 week ago

Question

21. What are the two kinds of stroke, and what causes each kindpg78

Answered: 1 week ago