This program is about stacks and queues please program simply and I need a detailed report and include the test cases. Use netbeans 8.2. The report should be on a word document and copy the code on the report.
Remember this assignment has two parts and each part is important! All of your programming assignments have an associated report and it is really important that both are of good quality and actually answer the questions! Remember you can submit up to 24 hours late (i.e. by 23:59 on 2020.03.29), but if you do so you will automatically lose 10% of your grade. No submission is permitted after the 24 hour late period after the deadline. I suggest you submit on time to maximise your grade! Method You will be completing a programming assignment and writing a small report. • Code assignment will be completed on and submitted through repl.it; • The report will be submitted on Canvas. Brief An office building has a long thin car park, wide enough for just one car, with an entrance at one end. There is a road that goes around the building. No reversing or overtaking is allowed on this road. When a car arrives at the building, they enter the car park and go in as far as possible, taking the next available space. When a car wants to leave, if the car is not nearest the exit, the owner has to get all the cars that are nearer to move. They all go out onto the road, and when the person has left, they come back into the car park in the order in which they exited. Make sure you use the existing libraries - the only file you need to work in is TinyCarPark! You need to simulate this by writing a class called TinyCarPark as follows: The class should have fields representing the car park and the road around the building using an appropriate data structure. The fields should be appropriately initialised. The class definition should be presented and documented to a high standard (variable names, comments, indenting, use of capital letters etc…) (20 marks) There should be a method arrive(String carOwner) which simulates the arrival of a new car driven by carOwner. This method should return the number of cars in the car park after the new car arrives. (20 marks) There should be a method leave(String carOwner) which simulates what happens when carOwner leaves. This method should return a string containing the names of the car owners who had to go onto the road, in order, followed by a ~ character. For example “Ann~Bob~Chen~”. If no owners had to go into the road (because carOwner was nearest the exit) then it should return the empty string. If carOwner was not in the car park, it should return null (and display an appropriate message). (40 marks) You should also include output statements in your methods explaining what is happening. For example “Ann goes into the car park”, “Bob goes into the road”, “Chen leaves”. (Remember that 20 further marks will come from your report explaining your solution). You have received an invitation to join repl.it. Any problems at all contact me immediately! (
[email protected]) Instructions In order to complete the assignment, you will need to first create an account on repl.it (Links to an external site.) if you do not have one. If you can’t access repl.it you can do the project in NetBeans. The project source file is below Once you have created your account, you can then start writing your solution to the problem. You can write the code for your solution directly in repl.it, or if you prefer, in your IDE of choice. Remember that I will be marking the submissions in repl.it, so if you do decide to work outside of repl.it, then make sure you copy+paste your most recent code into repl.it before the submission deadline. It is also VERY IMPORTANT to make sure that your code runs on repl.it, so be sure to test it! Testing your code: • On repl.it, you can run code just as you would when writing it on your computer. There is a "run" button (pictured below) above your code editing area, that when clicked, will execute the `public static void main(String[] args)` method, if one exists. If you are using NetBeans you need to test your code with the tests shown below. Repl.it will automatically run the same tests 80% of the marks are for the code 20% of the marks are for writing a short report answering these questions: 1. Compare the Stack and the Queue ADTs [10 marks] 2. Justify the data structures you chose to represent the road and the car park, explaining why they are suitable and any limitations they have [10 marks] https://repl.it/signup https://repl.it/signup Support Notes Practice Assignment: On repl.it, you will find that there are two assignments available to you. "Assignment 1" is the coursework and what you should complete and submit on time. "Practice Assignment" is provided for you to practice and learn about working with repl.it; it is there purely for to help you learn to use repl.it, and will not be marked or graded. I strongly suggest you complete the practice assignment first, so that you get used to writing and testing your Java code on repl.it, before completing the actual assignment. Here is a walkthrough of Agneau doing the practice assignment: Play media comment. https://canvas.sussex.ac.uk/courses/14954/assignments/31441 Remember this assignment has two parts and each part is important! All of your programming assignments have an associated report and it is really important that both are of good quality and actually answer the questions! Remember you can submit up to 24 hours late (i.e. by 23:59 on 2020.03.29), but if you do so you will automatically lose 10% of your grade. No submission is permitted after the 24 hour late period after the deadline. I suggest you submit on time to maximise your grade! Method You will be completing a programming assignment and writing a small report. • Code assignment will be completed on and submitted through repl.it; • The report will be submitted on Canvas. Brief An office building has a long thin car park, wide enough for just one car, with an entrance at one end. There is a road that goes around the building. No reversing or overtaking is allowed on this road. When a car arrives at the building, they enter the car park and go in as far as possible, taking the next available space. When a car wants to leave, if the car is not nearest the exit, the owner has to get all the cars that are nearer to move. They all go out onto the road, and when the person has left, they come back into the car park in the order in which they exited. Make sure you use the existing libraries - the only file you need to work in is TinyCarPark! You need to simulate this by writing a class called TinyCarPark as follows: The class should have fields representing the car park and the road around the building using an appropriate data structure. The fields should be appropriately initialised. The class definition should be presented and documented to a high standard (variable names, comments, indenting, use of capital letters etc…) (20 marks) There should be a method arrive(String carOwner) which simulates the arrival of a new car driven by carOwner. This method should return the number of cars in the car park after the new car arrives. (20 marks) There should be a method leave(String carOwner) which simulates what happens when carOwner leaves. This method should return a string containing the names of the car owners who had to go onto the road, in order, followed by a ~ character. For example “Ann~Bob~Chen~”. If no owners had to go into the road (because carOwner was nearest the exit) then it should return the empty string. If carOwner was not in the car park, it should return null (and display an appropriate message). (40 marks) You should also include output statements in your methods explaining what is happening. For example “Ann goes into the car park”, “Bob goes into the road”, “Chen leaves”. (Remember that 20 further marks will come from your report explaining your solution). You have received an invitation to join repl.it. Any problems at all contact me immediately! (
[email protected]) Instructions In order to complete the assignment, you will need to first create an account on repl.it (Links to an external site.) if you do not have one. If you can’t access repl.it you can do the project in NetBeans. The project source file is below Once you have created your account, you can then start writing your solution to the problem. You can write the code for your solution directly in repl.it, or if you prefer, in your IDE of choice. Remember that I will be marking the submissions in repl.it, so if you do decide to work outside of repl.it, then make sure you copy+paste your most recent code into repl.it before the submission deadline. It is also VERY IMPORTANT to make sure that your code runs on repl.it, so be sure to test it! Testing your code: • On repl.it, you can run code just as you would when writing it on your computer. There is a "run" button (pictured below) above your code editing area, that when clicked, will execute the `public static void main(String[] args)` method, if one exists. If you are using NetBeans you need to test your code with the tests shown below. Repl.it will automatically run the same tests 80% of the marks are for the code 20% of the marks are for writing a short report answering these questions: 1. Compare the Stack and the Queue ADTs [10 marks] 2. Justify the data structures you chose to represent the road and the car park, explaining why they are suitable