Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* * This program is on creating classes *Create a movie class that contains the following information: *The name of the movie, the movie rating,

/* * 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

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

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

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions

Question

Describe Balor method and give the chemical reaction.

Answered: 1 week ago

Question

How to prepare washing soda from common salt?

Answered: 1 week ago