Question Java CodeProblem 03: Ticket prices for a tourist attractionA tourist attraction offers three types of tickets:Regular adult tickets at 3.000 BHD per person, with a reduction of 10% for group of at least five persons.Student tickets at 2.500 BHD per person.Family tickets for two adults and two or more children. The price is 7.500 BHD with an additional 1.500 BHD for each child beyond two children.Write a program that calculates the total price of tickets. The program displays a menu with three options, lets the user select option, and then asks for the number of people in the party. It should then display the total amount due.The class CMPE160_HW2_part3 contains starter code for you to complete.package CMPE160_HW2;public class CMPE160_HW2_part3 { public static void main(String[] args) { // in this main method, print the message prompting the user to input a choice. //then you will call the calculatePrice method with their input as arguments to the method. } //modify the below methods as appropriate //this method should have two parameters:  //1. the first paramets indicates the choice //2. the second paramets indicates a number. If this is a regular or student ticket, this number would represent the number of tickets. //if it is a family ticket, this would indicate the number of children static double calculatePrice() { } } Output example:This program calculates your ticket price for the tourist attraction.1. Regular ticket2. Student ticket3. Family ticket4. QuitEnter your choice (1-4): 1Enter the number of regular tickets: 8The cost for this is BHD 21.600This program calculates your ticket price for the tourist attraction.1. Regular ticket2. Student ticket3. Family ticket4. QuitEnter your choice (1-4): 3Enter the number of children: 5The cost for this is BHD 12.000

YNGYZA The Asker · Computer Science

Java Code

Problem 03: Ticket prices for a tourist attraction

A tourist attraction offers three types of tickets:

• Regular adult tickets at 3.000 BHD per person, with a reduction of 10% for group of at least five persons.
• Student tickets at 2.500 BHD per person.
• Family tickets for two adults and two or more children. The price is 7.500 BHD with an additional 1.500 BHD for each child beyond two children.

Write a program that calculates the total price of tickets. The program displays a menu with three options, lets the user select option, and then asks for the number of people in the party. It should then display the total amount due.

The class CMPE160_HW2_part3 contains starter code for you to complete.

package CMPE160_HW2;

public class CMPE160_HW2_part3 {

public static void main(String[] args) {

// in this main method, print the message prompting the user to input a choice.

//then you will call the calculatePrice method with their input as arguments to the method.

}

//modify the below methods as appropriate

//this method should have two parameters:

//1. the first paramets indicates the choice

//2. the second paramets indicates a number. If this is a regular or student ticket, this number would represent the number of tickets.

//if it is a family ticket, this would indicate the number of children

static double calculatePrice() {

}

}

Output example:

This program calculates your ticket price for the tourist attraction.1. Regular ticket2. Student ticket3. Family ticket4. QuitEnter your choice (1-4): 1Enter the number of regular tickets: 8The cost for this is BHD 21.600This program calculates your ticket price for the tourist attraction.1. Regular ticket2. Student ticket3. Family ticket4. QuitEnter your choice (1-4): 3Enter the number of children: 5The cost for this is BHD 12.000

More