Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You can ignore the graphics.....the professor said not ti worry about graphics.....just follow the instructions on the second image i provided.....I already started working on

image text in transcribed
image text in transcribed
You can ignore the graphics.....the professor said not ti worry about graphics.....just follow the instructions on the second image i provided.....I already started working on it but i get stuck....NEED HELP really bad
Ferry Queues Using C++, Java, or Python, design a program to simulate the parking queues of the Cape May-Lewes Ferry. The image below shows the layout of the terminal. The next picture shows the queues of cars waiting to board. For the simplicity of this program, use total of 5 queues (Lanes 1 through 5) with each having a capacity of 20 cars, supporting 100 cars in total. To represent each Car, design a Car object that simply contains an ID number. Every time you create a Car object, make sure its ID is one greater than the previously created Car. The cars are first boarded on the ferry starting with Lane 1. Once Lane 1 is empty, then cars in Lane 2 are arded and so on. When the boat is full, the remaining cars will need to wait for the next boat. The next boat will start boarding from the lane where the previous boat left off. If, for example, a boat left off on Lane 2, the next boat will start its boarding with Lane 5. Once Lane 5 is emptied, the process starts over with Lane 1. For the simplicity of this program, we'll say a ferry has a capacity of 50 cars. The Driver Class/Main In a main function, you'll set up your 10 queue structures for storing Car objects. The program will indefinitely ask the user to enter one of the following three commands: add-Entering this command will cause the program to prompt for the number of cars to add to the lanes. The program will then generate the appropriate number of Car objects, and store them in the next available lane. The program will print how many cars were assigned to each lane. If the user tries to add cars for which there is no more room in any lane, add as many cars as possible and print how many cars were turned away. load - Entering this command will start the boarding process. The program will then remove the appropriate number of cars from the appropriate lanes. The program will print how many cars were removed from each lane and the lane numbers of the affected lanes (the total number of cars should add up to 100). exit-End/exit the program. If the user enters and invalid command, print an error message and ask them to try again. Ferry Queues Using C++, Java, or Python, design a program to simulate the parking queues of the Cape May-Lewes Ferry. The image below shows the layout of the terminal. The next picture shows the queues of cars waiting to board. For the simplicity of this program, use total of 5 queues (Lanes 1 through 5) with each having a capacity of 20 cars, supporting 100 cars in total. To represent each Car, design a Car object that simply contains an ID number. Every time you create a Car object, make sure its ID is one greater than the previously created Car. The cars are first boarded on the ferry starting with Lane 1. Once Lane 1 is empty, then cars in Lane 2 are arded and so on. When the boat is full, the remaining cars will need to wait for the next boat. The next boat will start boarding from the lane where the previous boat left off. If, for example, a boat left off on Lane 2, the next boat will start its boarding with Lane 5. Once Lane 5 is emptied, the process starts over with Lane 1. For the simplicity of this program, we'll say a ferry has a capacity of 50 cars. The Driver Class/Main In a main function, you'll set up your 10 queue structures for storing Car objects. The program will indefinitely ask the user to enter one of the following three commands: add-Entering this command will cause the program to prompt for the number of cars to add to the lanes. The program will then generate the appropriate number of Car objects, and store them in the next available lane. The program will print how many cars were assigned to each lane. If the user tries to add cars for which there is no more room in any lane, add as many cars as possible and print how many cars were turned away. load - Entering this command will start the boarding process. The program will then remove the appropriate number of cars from the appropriate lanes. The program will print how many cars were removed from each lane and the lane numbers of the affected lanes (the total number of cars should add up to 100). exit-End/exit the program. If the user enters and invalid command, print an error message and ask them to try again

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

Describe effectiveness of reading at night?

Answered: 1 week ago

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago