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...

1 answer below »
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
Answered Same DayJul 10, 2021

Answer To: Remember this assignment has two parts and each part is important! All of your programming...

Arun Shankar answered on Jul 15 2021
134 Votes
Assignment/build/built-jar.properties
#Wed, 15 Jul 2020 23:59:09 +0530
C\:\\Users\\Arun\ Shankar\ S\\Documents\\NetBeansProjects\\Assignment=
Assignment/build/classes/.netbeans_automatic_build
Assignment/build/classes/.netbeans_update_resources
Assignment/build/classes/assignment/Assignment.class
Assignment/build/classes/assignment/TinyCarPark.class
Assignment/build.xml

Builds, tests, and runs the project Assignment.


Assignment/dist/Assignment.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.4
Created-By: 14.0.1+7 (Oracle Corporation)
Class-Path:
X-COMMENT: Main-Class will be added automatically by build
Main-Class: assignment.Assignment
assignment/Assignment.class
assignment/TinyCarPark.class
Assignment/dist/README.TXT
========================
BUILD OUTPUT DESCRIPTION
========================
When you build an Java application project that has a main class, the IDE
automatically copies all of the JAR
files on the projects classpath to your projects dist/lib folder. T
he IDE
also adds each of the JAR files to the Class-Path element in the application
JAR files manifest file (MANIFEST.MF).
To run the project from the command line, go to the dist folder and
type the following:
java -jar "Assignment.jar"
To distribute this project, zip up the dist folder (including the lib folder)
and distribute the ZIP file.
Notes:
* If two JAR files on the project classpath have the same name, only the first
JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder.
If the classpath contains other types of files or folders, these files (folders)
are not copied.
* If a library on the projects classpath also has a Class-Path element
specified in the manifest,the content of the Class-Path element has to be on
the projects runtime path.
* To set a main class in a standard Java project, right-click the project node
in the Projects window and choose Properties. Then click Run and enter the
class name in the Main Class field. Alternatively, you can manually type the
class name in the manifest Main-Class element.
Assignment/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
Assignment/nbproject/build-impl.xml









































































































































































































































































Must set src.dir
Must set test.src.dir
Must set build.dir
Must set dist.dir
Must set build.classes.dir
Must set dist.javadoc.dir
Must set build.test.classes.dir
Must set build.test.results.dir
Must set build.classes.excludes
Must set dist.jar











































































































































































Must set javac.includes




























































...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here