Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Create the Movie Class Movie Class Step 1: Create a class named Movie. Step 2: Add the following attributes to the class:

Question 1 Create the Movie Class Movie Class Step 1: Create a class named Question 2 MyClass Class Complete the below program that implements a simple movie booking system. Table 1import java.util.*; public class MyClass ( public static void main(String args[]) { // Declare an ArrayList7 Prompt the user to select a seat type (VIP, Premium, Standard, Kida) System.out.print(

Question 1 Create the Movie Class Movie Class Step 1: Create a class named "Movie". Step 2: Add the following attributes to the class: -String Name:Represents the name of the movie. String showtime: Indicates the time at which the movie is scheduled to be shown. int availableSeats Stores the number of available seats for the movie. 0.25 Points -double ticketPrice: Represents the price of a ticket for the movie. Step 3: Implement a constructor for the Movie class to initialize its attributes Step 4: Create a toString method that returns a string which should include the movie's name, showtime, available seats, and ticket price. Question 2 MyClass Class Complete the below program that implements a simple movie booking system. Table 1 shows the price of each seat type (Vi 2 Premium 3:Standard, 4Kids). Table 1-Types of Seats 1. SeatType 1.1 1. 2 1.3 1.4 import java.util. public class MyClass ( public static void main(String args[]) { // Declare an ArrayList of type Movie I 1. Cost 1. 100 1.80 1.60 2 OF 2 QUESTIONS REMAINING 0.75 Points 1.40 9:26 pm import java.util. public class MyClass ( public static void main(String args[]) { // Declare an ArrayList of type Movie // Initialize the ArrayList with 5 different movies with one of the movies // named "Oppenheimer" and "Dead" // Print the number of available seats for the movie named "Oppenheimer" // remove the movie named "Dead" // Display all movies information using a for-each loop // create a 2D-Array called seats based on the table shown in Table 1. // create a Scanner I 7 Prompt the user to select a seat type (VIP, Premium, Standard, Kida) System.out.print("Please enter the type of ticket (1:VIP 2: Premium 3:Standard 4: Kida"); // Prompt the user for the number of tickets they want to purchase System.out.print("How many tickets are you purchasing?"); // calculate the cost of the tickets double cost 777; // Loop through the seat types to find the cost cost // get the price of each ticket (as shown in the // table, column 2) and multiply by numbercfticket // Print the total cost 2 OF 2 QUESTIONS REMAINING

Step by Step Solution

There are 3 Steps involved in it

Step: 1

It appears that youve provided a series of screenshots related to a programming assignment involving the creation of a Movie class in Java and the imp... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java Programming

Authors: Joyce Farrell

9th edition

1337397075, 978-1337397070

More Books

Students also viewed these Programming questions

Question

Were the plans for managing resistance to change realistic?

Answered: 1 week ago