Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

programming language: Java Question 2 (Marks: 30) Design a console application that will print a movie ticket for a customer. Make use of an abstract

image text in transcribedimage text in transcribed

programming language: Java
Question 2 (Marks: 30) Design a console application that will print a movie ticket for a customer. Make use of an abstract class named Tickets that contains variables to store the customer name, movie title, customer age and price of the movie. Create a constructor that accepts the customer name, movie title, customer age and price of the movie as parameters and create get methods for the variables. The Tickets class must implement an iTickets interface that contains the following: public interface iTickets { public void print_tickets(); } Create a subclass called TicketSales that extends the Tickets class. The Ticket Sales class must contain a constructor to accept the customer name, movie title, customer age and price of the movie as parameters. Write code for the print_tickets method which displays the customer name, movie title, movie price, discount and final cost due. A discount of 10% is applied if the customer's age is greater than or equal to 65. If the customer is under 65 years old, no discount is given. Finally, write a Movie_Tickets class to instantiate the Ticket Sales class. Sample output is shown below and you may use the same values to test your application. Example of input and output: Enter the customer name: Joe Bloggs Enter the movie: Avengers End Game Enter the customer age: 67 Enter the movie cost: 50 CUSTOMER: Joe Bloggs MOVIE: Avengers End Game COST: R 50.0 DISCOUNT: R 5.0 TOTAL: R 45.0 Mark Examiner Moderator 6 10 Marking Guideline iTickets interface class created Excellent: Correct declaration - 6 marks Good: Correct but just a minor error - 4 to 5 marks Developing: Attempted but not correct - 2 to 3 marks Poor: Not attempted - marks Abstract class created with Constructor, Variables, Methods and Input and Output. Implements the Interface. Excellent: Correct - 10 marks Good: Correct but just a minor error -5 to 9 marks Developing: Attempted but not correct - 2 to 4 marks Poor: Not attempted - marks Ticket Sales class created that extends the Ticket class Excellent: Correct - 7 marks Good: Correct but just a minor error - 4 to 6 marks Developing: Attempted but not correct - 2 to 3 marks Poor: Not attempted - O marks Use the Movie Tickets class to capture input and instantiate the TicketSales class Excellent: Correct - 3 marks Good: Correct but just a minor error - 2 marks Developing: Attempted but not correct - 1 mark Poor: Not attempted - marks Output produced as per sample Excellent: Correct - 3 marks Good: Attempted but not correct - 2 marks Developing: Attempted but not correct - 1 mark Poor: Not attempted - O marks 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions