-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMovieDriver.java
More file actions
54 lines (39 loc) · 1.35 KB
/
MovieDriver.java
File metadata and controls
54 lines (39 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import java.util.Scanner;
public class MovieDriver {
public static void Main(String[] args) {
String movieTitle;
String movieRate;
String numTicket;
String resp;
Scanner objK= new Scanner(System.in);
Movie movie = new Movie();
Scanner kbr = new Scanner (System.in);
do{
System.out.println("Please enter the title of movie");
resp= kbr.next();
movieTitle= objK.nextLine();
movie = movieTitle;
System.out.println("Please enter the movie’s rating");
movieRate= objK.nextLine();
movie = movieRate;
System.out.println("Please enter the number of tickets sold at the theater");
numTicket= objK.next();
movie = numTicket;
System.out.println(movie.toString());
System.out.println("Do you want to enter another movie? (y or n)");
resp= kbr.next();
}while (resp =="y");
/**
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 movie’s 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 movie’s toString method*/
}
}