Question: This program is on creating classes Create a movie class that contains the following information: The name of the movie, the movie rating, such as
This program is on creating classes Create a movie class that contains the following information: The name of the movie, the movie rating, such as G for general audience, PG for parental guidance, PG-13, etc, the year the movie was made, and the run time in minutes. You'll need instance data for each piece of information. The name of the movie, the rating, the year and the run time, as well as a public interface. Remember, when creating classes, You will need a constructor. *In your main program, you ask the user to enter the information about their favorite movie, including the title, the rating, the year and the run time, then create a movie object with the information. *Finally, print it out using a two String method *write comments in the source code. *Upload the Source Code, screen shot of the running program. */ import java.util.Scanner; /** * * @author */ public class MovieList { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner in = new Scanner(System.in); String movie, rating; int year, runtime; Movie favoriteMovie; System.out.println("Please enter movie title: "); movie = in.nextLine(); System.out.println("Please enter movie rating: "); rating = in.nextLine(); System.out.println("Please enter year produced: "); year = in.nextInt(); System.out.println("Please enter total runtime: "); runtime = in.nextInt(); favoriteMovie = new Movie(movie, rating, year, runtime); System.out.println(favoriteMovie.toString()); } } Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
