Uploaded by Faisal Tariq

Description of the lab 6

advertisement
Faisal Tariq
CET 3640
Description of the lab 6
For this lab I had to use eclipse application. I named my file as Ticket you can
name it anything you want. So, in this lab I had to make a program that have four
classes including in that four class we have one Main class where we use public
static void main(String[] args) {}. In that main class ticket, I had to define all
common operations and specify all the calculations in such a way that every
subclass must implement them. Then I had to implement a class called walkup
ticket and in that I had to show that that walkup tickets are 50 dollars. Then I had
to implement another class called Advance Ticket and in that I had to show that
the 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. Then I
had to implement another class called StudentAdvanceTicket and in that I had to
represent tickets purchased in advance by students. A student advance ticket is
constructed with a ticket number and with the number of days in advance that the
ticket was purchased. Student advance tickets purchased 10 or more days before
the event cost $15, and student advance tickets purchased fewer than 10 days
before the event cost $20 (half of a normal advance ticket). When a student
advance ticket is printed, the String should mention that the student must show
his or her student ID
UML DONE ON THE NEXT PAGE
UML
Ticket

number: int
 Ticket(int)
 getPrice():double
 toString():String
 printTicket(int):void
StudentAdvanceTicket
WalkupTicket
 Number:int
 StudentAdvanceTicket(int,int)
 getPrice():double
 toString():String
 WalkupTicket(int)
 Price(): int
AdvanceTicket




number:int
daysInAdvance:int
AdvanceTicket(int,int)
Price():int
Download