subject

The following (unfinished) program implements a digital line queuing system for an amusement park ride. The system allows a rider to reserve a place in line without actually having to wait. The rider simply enters a name into a program to reserve a place. Riders that purchase a VIP pass get to skip past the common riders up to the last VIP rider in line. VIPs board the ride first. (Considering the average wait time for a Disneyland ride is about 45 minutes, this might be a useful program.) For this system, an employee manually selects when the ride is dispatched (thus removing the next riders from the front of the line). Complete the following program, as described above. Once finished, add the following commands:
The rider can enter a name to find the current position in line. (Hint: Use the list. index() method.)
The rider can enter a name to remove the rider from the line.

riders_per_ride = 3 # Num riders per ride to dispatch
line = [] # The line of riders
num_vips = 0 # Track number of VIPs at front of line
menu = ('(1) Reserve place in line.\n' # Add rider to line
'(2) Reserve place in VIP line.\n' # Add VIP
'(3) Dispatch riders.\n' # Dispatch next ride car
'(4) Print riders.\n'
'(5) Exit.\n\n')
user_input = input(menu).strip().lower()
while user_input != '5':
if user_input == '1': # Add rider
name = input('Enter name:').strip().lower()
print(name)
line. append(name)
elif user_input == '2': # Add VIP
print('FIXME: Add new VIP')
# Add new rider behind last VIP in line
# Hint: Insert the VIP into the line at position num_vips.
#Don't forget to increment num_vips.
elif user_input == '3': # Dispatch ride
print('FIXME: Remove riders from the front of the line.')
# Remove last riders_per_ride from front of line.
# Don't forget to decrease num_vips, if necessary.
elif user_input == '4': # Print riders waiting in line
print('%d person(s) waiting:' % len(line), line)
else:
print('Unknown menu option')
user_input = input('Enter command: ').strip().lower()
print(user_input)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:30
What are ways to switch windows in excel? check all that apply. on the status bar, click the windows button, and then click the file name. on the task bar, click to display the excel jump list, and then click the file name. on the view tab, in the window group, click switch windows, and then click the file name. on the review tab, in the viewing group, click files, and then click the file name.
Answers: 1
question
Computers and Technology, 23.06.2019 08:30
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Now you’re on your own. include a short summary of this section with plots in your lab report. write a matlab script file to do steps (a) through (d) below. include a listing of the script file with your report. 1 the soundsc(xx,fs) function requires two arguments: the first one (xx) contains the vector of data to be played, the second argument (fs) is the sampling rate for playing the samples. in addition, soundsc(xx,fs) does automatic scaling and then calls sound(xx,fs) to actually play the signal. mcclellan, schafer, and yoder, dsp first, 2e, isbn 0-13-065562-7. prentice hall, upper saddle river, nj 07458. c 2015 pearson education, inc. 4 mcclellan, schafer and yoder, signal processing first. prentice hall, upper saddle river, new jersey, 2003. c 2003 prentice hall. (a) generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the 4000 hz sinusoids defined in the next part, part (b). use a definition for tt similar to part 2.2(d). if we use t to denote the period of the sinusoids, define the starting time of the vector tt to be equal to t , and the ending time as ct . then the two cycles will include t d 0. finally, make sure that you have at least 25 samples per period of the sinusoidal wave. in other words, when you use the colon operator to define the time vector, make the increment small enough to generate 25 samples per period. (b) generate two 4000 hz sinusoids with arbitrary amplitude and time-shift. x1.t / d a1 cos.2
Answers: 1
You know the right answer?
The following (unfinished) program implements a digital line queuing system for an amusement park ri...
Questions
Questions on the website: 13722367