Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Movie Suppose you want to have an application to keep track of all the movies you 've seen. The first step is to define a

image text in transcribed

Movie Suppose you want to have an application to keep track of all the movies you 've seen. The first step is to define a class that represents a Movie and all the information you want to store about it Write code in the file Movie.java to implement a class called Movie with the following fields (use the exact names): 1 name: a string for the name of the movie; 2 year: an integer for the year the movie was released; 3 director: a string for the director's name; 4 description: a string for a short description; 5 ratings an integer value ranging from 1 (horrible) to 5 (the best movie ever). Your class should also contain the following methods L. a constructor that takes as an argument the movie's name; 2 getter and setter methods for every field.Assume all inputs are valid 4 equals: with the following signature public boolean equals (Object other). Returns true if this object is the same as 5. compare To: with the following signature public int compareTo (Movie other). Returns 0 if this movie's name is toString: should return the string representation of this movie with the movie's name, year and ratings other object. Two objects are equal if they have the same name, director, and were released at the same year; lexicographically equal to other movie's name;-1 If this movie's name is less than the other movie's name lexicographically; 1 If this movie's name is greater than the other movie's name lexicographically

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_2

Step: 3

blur-text-image_3

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions