Question: Write a java code to create a Movie class to hold information about Movies; Attributes are Movies name Length of the movie Rating You can

Write a java code to create a Movie class to hold information about Movies; Attributes are

Movies name

Length of the movie

Rating

You can define other attributes if you need in your design

Your code should have at least one Specific Constructor.

public Movie(String movieName, int length)

Movie object should have the following Methods:

a)Required get/set methods

b )Methods newRating that accepts an integer as rating and calculates the overall rating of the movie.

c ) Display methods to print the movie information on the console.

Sample run 1:

Rate gone with the wind: 5

Rate gone with the wind: 3

Rate gone with the wind: 2

Rate gone with the wind: 5

Rate gone with the wind: 4

Movie information:

Movie name: gone with the wind

Length: 238

Rating: 3.8

Enter the name of the next movie: The Good, the Bad and the Ugly

Enter the length of the movie: 161

Rate The Good, the Bad and the Ugly: 5

Rate The Good, the Bad and the Ugly: 5

Rate The Good, the Bad and the Ugly: 1

Rate The Good, the Bad and the Ugly: 2

Rate The Good, the Bad and the Ugly: 3

Movie information:

Movie name: The Good, the Bad and the Ugly

Length: 161

Rating: 3.2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!