Question: Help c++ or java After more than ten years and twenty films building up to the final climax, The Arrangers movie is premiering in cinemas

Help c++ or java

After more than ten years and twenty films building up to the final climax, "The Arrangers" movie is premiering in cinemas today and the ticket line will be long. You are the first of your friends to arrive and there is no more room inside, so you must buy all the tickets. You can only buy one ticket at a time, so if you need more than one, you must go back to the end of the line until you have as many as you need. Each ticket takes exactly one minute to buy. Write a program calculate how many minutes you will spend in line, so you can tell your friends when to arrive. Input from the keyboard a series of positive integers indicating the number of tickets (no more than 12) that each person wants to buy. The second value indicates your initial position in line, starting from "1". Output an integer indicating how many minutes you will be in line until you buy all the tickets. Use a queue data structure. Refer to the sample output below.

Sample Run:

Enter the number of tickets each person wants to buy (12 or less): 2 2 4 1 3

Enter your starting position in line: 3 Wait time: 12 minutes

Name the program: WaitTimeXX.java or WaitTimeXX.cpp, where XX are your initials.

Help c++ or java After more than ten years and twenty films

2. After more than ten years and twenty films building up to the final climax, "The Arrangers" movie is premiering in cinemas today and the ticket line will be long. You are the first of your friends to arrive and there is no more room inside, so you must buy all the tickets. You can only buy one ticket at a time, so if you need more than one, you must go back to the end of the line until you have as many as you need. Each ticket takes exactly one minute to buy. Write a program calculate how many minutes you will spend in line, so you can tell your friends when to arrive. Input from the keyboard a series of positive integers indicating the number of tickets (no more than 12) that each person wants to buy. The second value indicates your initial position in line, starting from "1". Output an integer indicating how many minutes you will be in line until you buy all the tickets. Use a queue data structure. Refer to the sample output below. Sample Run: Enter the number of tickets each person wants to buy (12 or less): 2 2 4 1 3 Enter your starting position in line: 3 Wait time: 12 minutes 2. After more than ten years and twenty films building up to the final climax, "The Arrangers" movie is premiering in cinemas today and the ticket line will be long. You are the first of your friends to arrive and there is no more room inside, so you must buy all the tickets. You can only buy one ticket at a time, so if you need more than one, you must go back to the end of the line until you have as many as you need. Each ticket takes exactly one minute to buy. Write a program calculate how many minutes you will spend in line, so you can tell your friends when to arrive. Input from the keyboard a series of positive integers indicating the number of tickets (no more than 12) that each person wants to buy. The second value indicates your initial position in line, starting from "1". Output an integer indicating how many minutes you will be in line until you buy all the tickets. Use a queue data structure. Refer to the sample output below. Sample Run: Enter the number of tickets each person wants to buy (12 or less): 2 2 4 1 3 Enter your starting position in line: 3 Wait time: 12 minutes

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!