Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Students also viewed these Databases questions