Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class MovieDriver {
- public static void main(String[] args) {
- Scanner input = new Scanner("System.in");
- Movie movie = new Movie();
- String title;
- String rating;
- int soldTickets;
- byte loop;
- do {
- System.out.println("Enter the title of a movie");
- title = input.nextLine();
- movie.setTitle(title);
- System.out.println("Enter the rating of the movie");
- rating = input.nextLine();
- movie.setRating(rating);
- System.out.println("Enter the number of tickets sold for this movie");
- soldTickets = input.nextInt();
- movie.setSoldTickets(soldTickets);
- movie.toString();
- System.out.println("Do you want to enter another? (y or n)");
- loop = input.nextByte();
- }while(loop == 'n' || loop == 'N');
- System.out.println("Goodbye");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement