SHARE
TWEET

Untitled

a guest Feb 18th, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class MovieDriver {
  4.  
  5.     public static void main(String[] args) {
  6.    
  7.         Scanner input = new Scanner("System.in");
  8.         Movie movie = new Movie();
  9.         String title;
  10.         String rating;
  11.         int soldTickets;
  12.         byte loop;
  13.    
  14.     do {
  15.         System.out.println("Enter the title of a movie");
  16.         title = input.nextLine();
  17.    
  18.         movie.setTitle(title);
  19.    
  20.    
  21.         System.out.println("Enter the rating of the movie");
  22.         rating = input.nextLine();
  23.    
  24.         movie.setRating(rating);
  25.    
  26.    
  27.         System.out.println("Enter the number of tickets sold for this movie");
  28.         soldTickets = input.nextInt();
  29.    
  30.         movie.setSoldTickets(soldTickets);
  31.    
  32.    
  33.         movie.toString();
  34.    
  35.    
  36.         System.out.println("Do you want to enter another? (y or n)");
  37.         loop = input.nextByte();
  38.    
  39.     }while(loop == 'n' || loop == 'N');
  40.     System.out.println("Goodbye");
  41.     }
  42.    
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top