Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Programming AP Computer Science Lab: Tickets Part 1: Write the following classes from the UMLs. See additional information below. Ticket (Italics = abstract) int

Java Programmingimage text in transcribed

AP Computer Science Lab: Tickets Part 1: Write the following classes from the UMLs. See additional information below. Ticket (Italics = abstract) int num Tickets double price Ticket(int numin) int getNum Tickets() double getPrice) void setPrice(double priceln) String toString() The toString method returns num Tickets + "tickets". WalkUpTicket WalkUp Ticket(int numin) String toString() Advance Ticket static int days Advance Ticket(int numin, int daysIn) String toString() Student Adv Ticket StudentAdvTicket(int numin, int daysn) String toString() WalkUpTicket: Walk-up tickets are purchased the day of the event and cost $50. The toString method should return "num Tickets same-day tickets at $50 is Advance Ticket: Advance tickets purchased 10 or more days before the event cost $30, and advance tickets purchased fewer than 10 days before the event cost $40. (Tickets purchased on the day of the event are Walk- up tickets.) The toString method should return "num Tickets advance tickets at $ is " StudentAdvTicket: Student advance tickets are sold at half the price of normal advance tickets: 10 or more days early are $15 and fewer than 10 days are $20. Same day student tickets are Walk-up tickets. The toString method should return the same information format as Advance Ticket, with the addition of "Student ID Required". (Use the parent toString() method.) *Have the constructors set the price

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_2

Step: 3

blur-text-image_3

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions