Need help on this. Must be in java. Make the code uniqie and no plagerism.
for the following four problems, consider the task of representing ticket types for campus events. Each ticket has a unique number and price. There are three types of tickets: walk-in tickets, advance tickets, and student advance tickets. Figure 9.10 illustrates the types: • Walk-in tickets are purchased on the day of the event and cost $ 50. • Advance tickets purchased 10 or more days prior to the event cost $ 30 and advance tickets purchased less than 10 days prior to the event. event cost $ 40. Student Advance Tickets are sold at half the price of regular Advance Tickets - when purchased 10 or more days in advance, they cost $ 15, and when purchased less than 10 days in advance, they cost $ 20. Implement a class called Ticket that will serve as the superclass for all three types of tickets. Define all the common operations in this class and specify all the different operations in such a way that each subclass must implement them. No real objects of type Ticket will be created: Each real ticket will be an object of a subclass type. Define the following operations: • The ability to build a ticket by number. • The possibility of requesting the price of a ticket. • The ability to print a ticket object as a string. An example of a string would be "Number: 17, Price: 50.0". Ticket number Ticket (number) getPrice) toString Walkup Ticket Advance Ticket Advance Ticket for Students Figure 9.10 Ticket classes that are available for campus events 644 Chapter 9 Heritage and interfaces 6. Implement a class called WalkupTicket to represent an event ticket without appointment. Walk-in tickets are also built by number and are priced at $ 50. 7. Implement a class called AdvanceTicket to represent tickets purchased in advance. An advance ticket is built with a ticket number and the number of days in advance the ticket was purchased. Advance tickets purchased 10 or more days prior to the event are $ 30 and advance tickets purchased less than 10 days prior to the event are $ 40. 8. Implement a class called StudentAdvanceTicket to represent tickets purchased in advance by students. A student advance ticket is built with a ticket number and the number of days in advance the ticket was purchased. Advance student tickets purchased 10 or more days before the event cost $ 15, and advance student tickets purchased less than 10 days before the event cost $ 20 (half of a normal advance ticket). When a student advance ticket is printed, the chain must mention that the student must show their student ID (for example, "Number: 17, Price: 15.0 (ID required)").
Trending nowThis is a popular solution!
Step by stepSolved in 8 steps
- Consider a call centre with three personnel levels: responder, manager, and director. An incoming phone call must first be assigned to a responder who is available. If the respondent is unable to handle the call, it must be escalated to a manager. If the manager is unavailable or unable to handle the situation, the call should be escalated to a director. Create the classes and data structures needed for this problem. Create a dispatchCall () method that assigns a call to the first available employee.arrow_forwardI need help writing a C++ code. I need help writing a function that accepts a C-string as an argument and returns the number of words contained in the string. Let's say the string argument is "Howdy Partner" the function should return the number 2. Demonstrate the function in a program that asks the user to input a string and then pass it to the function. The number of words in the string should be displayed on the screen.arrow_forwardsolution in python languagearrow_forward
- 2 class lineType Instructions 3 { 4 public: The equation of a line in standard form is ax void setline (double a = 0, double b = 0, doublec = e); + by = c, wherein both a and b //Function to set the line. 7 8 void equation() const; cannot be zero, and 9 a, b, and c are double getXCoefficient() const; 10 real numbers. If b#0, double getYCoefficient() const; 11 then -a/b is the slope double getconstantTerm() const; 12 13 of the line. If a = 0, 14 void setXCoefficient (double coeff); then it is a horizontal 15 void setYCoefficient(double coeff); line, and if b = 0, then 16 void setConstantTerm(double c); it is a vertical line. The 17 slope of a vertical line double slope() const; 18 is undefined. Two lines are parallel if 19 //Return the slope. This function does not check if the 20 //line is vartical. Because the slope of a they have the same vertical line slope or both are //is undefined, before calling this function 21 vertical lines. Two check if the lines are 22 //line is nonvertial.…arrow_forwardAssume that CSCourse class has been written, which has the below UML Diagram. You are giyen the CourseManager class and are asked to complete the main method. Write a body of the main method only that creates two objects of type CSCourse, so that: the first CSCourse is named "CS210% and has 32 students and an average GPA of 3.1 the second CSCourse is named "CS211" and has 31 students and an average GPA of 3.4 sum the students in two courses using the getNumStudents() method, and print the sum to the screen. C) cSCourse name : String -numStudents: int -averageGPA double +CSCourse(name String, numStu int) +getNumStudents() int +getName(): String +setAverageGPA(AVGPA: double) : void public class CourseManager{ public static void main(String[] args) [ / Your code goes here // Sample output is "Sum of students: 63".arrow_forwardA list of projects and a list of dependencies, or a list of project pairings where the second project depends on the first project, are provided to you. Before starting a project, all of its dependencies must be built. Find a build order that enables the construction of the projects. Return an error if there is no proper construction order. EXAMPLEInput:projects: a, b, c, d, e, fdependencies: (a, d), (f, b), (b, d), (f, a), (d, c)Output: f, e, a, b, d, carrow_forward
- I need help with the main function, please. I have all classes I need I just need the main functionarrow_forwardHelp, I am making a elevator simulation using polymorphism. I am not sure to do now. Any help would be appreciated. My code is at the bottom, that's all I could think off. There are 4 types of passengers in the system:Standard: This is the most common type of passenger and has a request percentage of 70%. Standard passengers have no special requirements.VIP: This type of passenger has a request percentage of 10%. VIP passengers are given priority and are more likely to be picked up by express elevators.Freight: This type of passenger has a request percentage of 15%. Freight passengers have large items that need to be transported and are more likely to be picked up by freight elevators.Glass: This type of passenger has a request percentage of 5%. Glass passengers have fragile items that need to be transported and are more likely to be picked up by glass elevators. public abstract class Passenger { public static int passangerCounter = 0; private String passengerID; protected…arrow_forwardin C Write aprogram that simulates multiple contractors who are making bids to contracts with the city council.In the simulation, there are at least four bidderswho bid based on the pricing below: Bidders 1 & 2 bid lower prices based on a uniform value from the range [1-7], inclusive. •The last two bidders bid higher prices based on a uniform value from the range [3-10], inclusive. •All other biddersbid prices based ona uniform value in the range [1-10], inclusive.arrow_forward
- Using Java an elevator simulator that uses polymorphism and object-oriented programming tosimulate the movement of elevators in a building with multiple types of passengers and elevators.The system has 8 elevators, each of which can be one of 4 types of elevators, with a certainpercentage of requests for each type. Similarly, each passenger can be one of 4 types, with adifferent percentage of requests for each type. Passenger Types:There are 4 types of passengers in the system:Standard: This is the most common type of passenger and has a request percentage of 70%.Standard passengers have no special requirements.VIP: This type of passenger has a request percentage of 10%. VIP passengers are given priorityand are more likely to be picked up by express elevators.Freight: This type of passenger has a request percentage of 15%. Freight passengers have largeitems that need to be transported and are more likely to be picked up by freight elevators.Glass: This type of passenger has a request…arrow_forwardSolve using OOP in Java.arrow_forwardYou are given a list of projects and a list of dependencies (which is a list of pairs ofprojects, where the second project is dependent on the first project). All of a project's dependencies must be built before the project is. Find a build order that will allow the projects to be built. If there is no valid build order, return an error.EXAMPLEInput:projects: a, b, c, d, e, fdependencies: (a, d), (f, b), (b, d), (f, a), (d, c)Output: f, e, a, b, d, carrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education