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
Get step-by-step solutions from verified subject matter experts
