Question: Java Code for Concert Tickets Write classes for concert ticket according to the following requirement: 1) Write a class called Concert that contains instance data

Java Code for Concert Tickets

Write classes for concert ticket according to the following requirement:

1) Write a class called Concert that contains instance data that represents the Musician, date (time), location, and price of ticket.

2) Define the Concert constructor to accept and initialize these instance variables.

3) Override Concert constructor, using setter and getter methods for all instance data, which read concert information from the client.

4) Write a toString method that returns a description of the concert.

5) Write a method called isExpensive that returns a Boolean value indicating if the concert ticket is too expensive (if the price is more than $100).

6) Write a method called Payment that accepts one parameters which represent ordering ticket from 3 different ways:

Box Office: 0 % discount

Box Office with coupon: 50% discount

Online: 40% discount

Return a final payment according to the above different condition.

7) Create a driver class called ConcertTicket, whose main method instantiates and updates several Concert objects. We can invoke toString, isExpensive and Payment method in driver class and check information about each concert .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!