Question: A. Write a java program that do the following: Create a class named Concert that consists of the following: Three instance data members of private

A. Write a java program that do the following: Create a class named Concert that consists of the following: Three instance data members of private access modifier: concertNo: represents the serial number the concert and its data type is integer. concertType: represents the display type of the Concert and its data type is string. concertCapacity: represents the numberof people who can attend the concert and its data type is integer. ticketPrice: represents the price of the ticket and its data type is double. One static data member of public access modifier: ticketsSold: keeps track of the number of ticket's objects that are created from the concert class. Its type is integer, initialize it with 300. . Member methods as follows: 1. Default constructor to initialize the concertNo to zero, concertType to empty string, and the concertCapacity, and ticketPrice to zero. 2. Parameterized constructor that receives values for the following data members(concertNo, concertType, and concertCapacity, ticketPrice), then it sets the received values in the class data members. 3. Create a method named setTicketPrice that sets a value in theticketPricedata member. Be sure that the value is realistic (more than 15 JD). 4. Create a method named getConcertNo that returns the value of the concertNo. 5. Create a method named soldOut that returns true if the ticketsSold is greater than or equals tothe concertCapacity, and returns false otherwise. 6. Create a method named findTicketPricethat returns the ticketcost according to the following: If the concert type is comody, the ticket cost is 30 JD. If the concert type is choral music, the ticket cost is 35 JD. Otherwise, the ticket cost is 25 JD. 7. Create a method named showConcertDetails that prints the values of the data members in the following format: Example 1: If the values in the created object is (concertNo =323, concertType=comody, and the concertCapacity = 600) The concert no. is 323 and its type iscomedy. The ticket costs 30 JD. However, the tickets are not sold out yet. Example 2: If the values in the created object that(concertNo =2299, concertType=Opera, and the concertCapacity = 200) The concert no. is 2299 and its type is Opera. The ticket costs 25 JD. However, the tickets are sold out. [Hint: you may use the soldOut function to detect if the tickets are sold out or not]. B. Write a Demo class that contains the main method. In the main method do the following: 1. Create an object of the Concert class named concertOne using the default constructor. 2. Create another object of the Concertclass named concertTwo using the parameterized constructor. Ask the user to input the concertNo, concertType, and the concertCapacity. 3. Call the method setTicketPrice for the concertOneobject to set the price of that object to be 75. 4. Print the value of the ticketsSoldstatic data member. 5. Call the showConcertDetails method using the object concertOne. 6. Call theshowConcertDetailsmethod using the object concertTwo

write programm in java / neatbeans

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!