Question
Write Java code to implement the following pseudocode: Create a new object of type Scanner that reads from the keyboard Create a new movie object
Write Java code to implement the following pseudocode:
Create a new object of type Scanner that reads from the keyboard
Create a new movie object
Prompt the user to enter the title of a movie
Read in the line that the user types
Set the title in the movie object
Prompt the user to enter the movies rating
Read in the line that the user types
Set the rating in the movie object
Prompt the user to enter the number of tickets sold at a (unnamed) theater
Read in the integer that the user types
Set the number of tickets sold in the movie object
Print out the information using the movies toString method
This is what I have so far
import java.util.Scanner;
public class MovieDriver {
public static void main(String[] args) {
//Scanner object for input
Scanner keyboard = new Scanner(System.in);
int n; //Controls the Loop
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started