Question: Below, you will be presented with java statements that you need to organize properly to solve the algorithm presented in the previous question. Exercise: Write

Below, you will be presented with java statements that you need to organize properly to solve the algorithm presented in the previous question.

Exercise: Write an application that determines the total amount of money needed to buy any number of tickets to a concert. The user is asked to enter an integer value representing the number of tickets and a double value representing the price of each ticket. In addition, the user is asked to enter the name of the concert. Finally, display the name of the concert and the total amount of money needed. Assume that you are buying all the tickets from the same category or type.

Below is a sequence of events. Place them in the order they should occur, number 1 being the first item. Select the step number from the drop down next to each item.

Items to order:

1.

System.out.println("Enter the name of the concert:");

2.

int tickets;

double price, totalPrice;

String concert;

Scanner input = new Scanner(System.in);

3.

System.out.println("Please enter the number of tickets:");

4.

totalPrice = tickets * price;

5.

System.out.println("The name of the concert is " + concert + " and you need " + totalPrice + " dollars");

6.

System.out.println("Please enter the unit price of each ticket:");

7.

concert = input.next();

8.

tickets = input.nextInt();

9.

price = input.nextDouble();

System.out.println("Enter the name of the concert:");

4

int tickets;

double price, totalPrice;

String concert;

Scanner input = new Scanner(System.in);

6

System.out.println("Please enter the number of tickets:");

7

totalPrice = tickets * price;

5

System.out.println("The name of the concert is " + concert + " and you need " + totalPrice + " dollars");

3

System.out.println("Please enter the unit price of each ticket:");

2

concert = input.next();

5

tickets = input.nextInt();

3

price = input.nextDouble();

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!