Task 3. Add Queue. Add a waiting list to your Cruise Ship class version. Modify your...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Task 3. Add Queue. Add a waiting list to your Cruise Ship class version. Modify your 'A: Add' and 'D: Delete' as follows: • When you press 'A' to add a new customer, the customer should be added to the Waiting List queue if the Cruise Ship is full. When you press 'D' to delete a customer from a cabin, the next customer in the Waiting List queue should be automatically placed in the cabin. Extra marks will be awarded if you implement the waiting list queue as a circular queue. Task 3. Add Queue. Add a waiting list to your Cruise Ship class version. Modify your 'A: Add' and 'D: Delete' as follows: • When you press 'A' to add a new customer, the customer should be added to the Waiting List queue if the Cruise Ship is full. When you press 'D' to delete a customer from a cabin, the next customer in the Waiting List queue should be automatically placed in the cabin. Extra marks will be awarded if you implement the waiting list queue as a circular queue.
Expert Answer:
Answer rating: 100% (QA)
Heres the complete updated CruiseShip class with the Queue class and the required modifications class Customer def initself name selfname name class Cabin def initself selfcustomer None selfisempty Tr... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
Write an alternative definition that is tail-recursive (iterative) and makes use of accumulator variables. [10 marks] Explain why your alternative definition executes more efficiently. [3 marks] 1...
-
How are writable CDs implemented?
-
The members of a population have been numbered 1-500. A sample of size 10 is to be taken from the population, using stratified random sampling with proportional allocation. The strata are of sizes...
-
Stock C is expected to pay a dividend of $2.80 next year. Between Year 1 and Year 4, the dividends are expected to grow 15% per year. Starting from Year 5, the dividend growth rate will be 1%. If the...
-
A 2-m-diameter pipe made of finished concrete lies on a slope of 1-m elevation change per \(1000-\mathrm{m}\) horizontal distance. Determine the flowrate when the pipe is half full.
-
Tim Snyder and Jay Wise have decided to form a partnership. They have agreed that Snyder is to invest $30,000 and that Wise is to invest $40,000. Snyder is to devote full time to the business, and...
-
1. Write a program in python to get the number of rows using GUI. If the user entered less than 4 rows, display the message not to enter less than 4 rows and allow the user to enter again. For...
-
Hauck Financial Services has a number of passive, buy-and-hold clients. For these clients, Hauck offers an investment account whereby clients agree to put their money into a portfolio of mutual funds...
-
You have decided that you will go to law school after graduation, which will be a 3-year program. You want to borrow enough money to cover all 3 years of law school (tuition, books, rent, food,...
-
After you have studied Reading Between the Lines on answer the following questions. a. In what ways do employers break laws in the underground labor market described in the news article? b. How does...
-
Nevada has plenty of jobs for the over 50s and its elderly population is growing faster than that in other states. Explain how grannies have influenced: a. The demand in some Las Vegas markets. b....
-
Mississippi cracked down on gougers after Hurricane Katrina. John Shepperson was one of the gougers authorities arrested. Shepperson lives in Kentucky and he watched news reports about Katrina and...
-
A carbon tax would raise the cost of producing goods and services that create large carbon emissions, but it would encourage Americans to use less carbon-intensive goods and services, which could...
-
In an hour, Sue can produce 40 caps or 4 jackets and Tessa can produce 80 caps or 4 jackets. Who has a comparative advantage in producing caps? If Sue and Tessa specialize and trade, who will gain?
-
1). How well did your actual income and expenses compared to the budgeted expenses? 2). What factors contributed to you not actually spending as you planned to spend? 3). Were the factors identified...
-
Consider the reaction of acetic acid in water CH 3 CO 2 H(aq) + H 2 O(l) CH3CO 22 (aq) + H 3 O + (aq) where Ka 5 1.8 3 1025. a. Which two bases are competing for the proton? b. Which is the stronger...
-
According to the article Self-injurious Behaviors in a College Population, 17% of undergraduate or graduate students have had at least one incidence of self-injurious behavior. The researchers...
-
Explain the procedure for testing a hypothesis using the Classical Approach. What is the criterion for judging whether to reject the null hypothesis?
-
Suppose a fundraiser holds a rafe for which each person who enters the room receives a ticket. The tickets are numbered 1 to N, where N is the number of people at the fundraiser. The rst person to...
-
For the attached flows over slender delta wings, show that at low angles of attack Eqs. 1.11 and 1.33 are identical. Eq 1.11 Eq 1.13 = 1 2 AR CL=
-
The ellipsoid given in Problem 2.3 is also undergoing a pulsative major axis change with the same period but with phase difference \(\phi\). Express the equation of surfaces. Problem 2.3 An oblate...
-
Express the components of stress tensor in generalized coordinates in terms ofvelocity gradients.
Study smarter with the SolutionInn App