logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

This project will be built using a number of classes representing the component pieces of the project. Here we provide a description of these classes.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Basic Procedures

Project 2: Syeda

  • Fill out a txt file with your information (goes in your user folder, an example is provided)

  • Have a style (indentation, good variable names, )

  • Comment your code well in JavaDoc style (no need to overdo it, just do it well)

  • Have code that compiles with the command: javac *.java in your user directory

  • Have code that runs with the command: java Simulate [numPlates > 0]

You may:

  • Add additional methods and variables where indicated (each class has its own restrictions). If it doesn’t say you may add something, then you may not add

You may NOT:

  • Add any additional methods or instance variables except where

  • Make your program part of a

  • Add additional public methods or

  • Use any built in Java Collections Framework classes anywhere in your program (e.g. no ArrayList, LinkedList, HashSet, ).

  • Use any arrays anywhere in your

  • Alter any method signatures defined in this document of the template code. Note: “throws” is part of the method signature in Java, don’t add/remove

  • Alter provided classes/methods that are complete (Stack, Queue, Simulate, ).

  • Add any additional import statements (or use the “fully qualified name” to get around import statements).

  • Add any additional libraries/packages which require downloading from the

Setup

  • Download the zip and unzip it. This will create a folder section-yourGMUUserName-p2

  • Rename the folder replacing section with the 001, 003, 004 based on the lecture section you are in

  • Rename the folder replacing yourGMUUserName with the first part of your GMU email address

  • After renaming, your folder should be named something like: 001-krusselc-p2

  • Complete the txt file (an example file is included: exampleReadmeFile.txt)

Grading Rubric

Due to the complexity of this assignment, an accompanying grading rubric pdf has been included with this assignment. Please refer to this document for a complete explanation of the grading.

Overview: What Goes Up Must Come Down (Spinning Plates)

You are going to build a small game using linked lists. You will have a plate spinner (Syeda) who is using three data structures to spin plates (her hands, a bin, and the air). Her hands will be modeled with a simple data structure that holds a single plate at a time. The bin will be modeled as a stack data structure which can hold any number of items. The air will be modeled as a queue data structure which can hold a specific number of items. An outline has been provided for these classes in the zip file with this document.

 

What does the Syeda look like?

There are five plates in the picture above: 2 in the air, 1 in the bin, and 1 in each of Syeda’s hands. The bin is a stack, new plates are placed on top and plates are taken off the top. The air is a queue, the front of the queue in this picture is plate (b) and the back is plate (c). Plates are thrown into the back of the queue and taken out of the front of the queue. This produces what is known as the “shower trick” in juggling.

This project is a little different from Project 1: you will not be writing the “driver” program for this, but instead focusing on your data structure implementations. If you complete all the required classes, then the menu, game interactions, and the ASCII part should just work. If it doesn’t, there’s something wrong with one of your implementations!

Requirements

An overview of the requirements are listed below, please see the grading rubric for more details.

  • Implementing the classes - You will need to implement required classes and provided template

  • Big-O - The template files provided to you contains instructions on the REQUIRED Big-O runtime for many methods. Your implementation of those methods should NOT have a higher Big-O.

  • Style – You must follow the coding and conventions specified by the style

  • JavaDocs - You are required to write JavaDoc comments for all the required classes and

Input Format(s)

No file I/O is required for this project.

Implementation/Classes

This project will be built using a number of classes representing the component pieces of the project. Here we provide a description of these classes. Template files are provided for each class in the project folder and these contain further comments and additional details.

Completed Classes and Interfaces

  • The Plate Class (see Plate.java) This class is complete. It creates plates with letters.

  • The Stack Interface (see java) This interface is done for you and outlines the required methods for the Bin class.

  • The Queue Interface (see java) This interface is done for you and outlines the required methods for the Air class.

  • The Simulate Class (see java) This class is done for you and you can use it to simulate Syeda’s movements. Enjoy the beautiful ASCII art!

Required Classes

  • The AttachedList<T> Class (see AttachedList.java) This class, as outlined, is a linked list. It implements Java’s List interface as outlined in the class, you’ll also be adding a few new methods: slice(), reverseCopy(), pack(), and flatten().

  • Note: Not all the methods in this class are needed by the simulation of Syeda, but they are all graded. The simulation is to give you some practice using these classes (and something fun to look at), but the project itself is about linked lists, stacks, and

  • The Bin Class (see Bin.java) This class implements the interface Stack<Plate>. It keeps an

AttachedList to use as its internal storage.

  • The Air Class (see Air.java) This class implements the interface Queue<Plate>. It keeps an

AttachedList to ue as its internal storage.

  • The Hand Class (see java) This class can store a single item (a plate). It’s the simplest one.

  • The Spinner lass (see java) This class does the handoffs (no pun intended) between the bin, the air, and Syed’s hands.

Testing

  • Empty main methods for testing are given to you, so no test code is 1

  • You can run the simulation of Syeda once everything is

    • Note: Testing via the simulation only is not a good Many of the methods you need to write are not used by the simulation, but are still a graded part of the project.

  • Make sure you’re running the style checker and javadoc style

1 Why are we being so cruel?? So that you are prepared for the future... Think of it this way, if your parents never let you try feeding yourself as a kid and you didn’t experience spilling food on the floor a bunch and being sad about it, you wouldn’t be the refined diner you are today. Same thing for testing, if you don’t learn to do it yourself, you’re going to look like a slob when you go to your first job and not the ultra-cool new hotshot you know you are.

How To Handle a Multi-Week Project

While this project is given to you to work on over two and a half weeks, and you are unlikely to be able to complete this in one weekend if you don’t plan ahead. We recommend the following schedule:

  • Step 1 (Understanding the Code): Before the first weekend (before 9/20)

    • Read project specification, inspect the given template files and get yourself familiar with the sample Make sure to investigate all the methods you’ll be writing in each class and start planning which methods can be used to help when writing others.

    • You’ll want to review

  • Step 2 (AttachedList): First weekend (9/20-9/22)

    • You’ve learned about linked lists in class last week and had some review this week, so go ahead and complete AttachedList if you haven’t done so before the weekend. These methods should be familiar to you, but slice(), reverseCopy(), pack(), and flatten() might take some additional

    • Test as you go and write as you test. Rather than writing the class from “top to bottom”, determine an order to implement the methods which would be easy to test. For example, it would be hard to test remove() until after you’re sure you have a working add().

    • Also, do the style and comment checking as you go, no one wants to sit around writing JavaDocs for an entire project all at once... don’t do that to

    • If you’re struggling... go to office hours as soon as you can!

  • Step 3 (Bin,Air): Before the second weekend (9/23-9/26)

    • You’ve learned about stacks and queues in class and are reviewing that material this week, so make the Bin and Air classes which are stacks and queues! They’re very simple ..

    • Test as you go, do the style and comment checking

  • Step 4 (Hand,Spinner): Second weekend (9/27-9/29)

    • Now you’re almost set... finish up by writing the Hand and Spinner classes which connects all the parts together, and run the simulation J

This schedule will leave you with the third week and third weekend (9/30-10/6) to perform additional testing, get additional help, and otherwise handle the rest of life. J Also, notice that if you get it done early in the week, you can get extra credit! Check our grading rubric PDF for details. Otherwise you'll have plenty of time to test and debug your implementation before the due date.

Sample Run

> java Smulate 5

Syeda, the plate spinner, is learning to do a shower trick...

She has 5 plate(s) to work with

( )

(a)    \ | /

  • |

  • |

  • / \

  • / \

 

Syeda can:

  • Pick up a plate from the bin

  • Spin a plate into the air

  • Catch a plate from the air

  • Pass a plate between hands

  • Put a plate down on the bin

  • Quit

What should she do? 1

 

(a)( )

\ | /

  • |

  • |

  • / \

  • / \

Syeda can:

  • Pick up a plate from the bin

  • Spin a plate into the air

  • Catch a plate from the air

  • Pass a plate between hands

  • Put a plate down on the bin

  • Quit

What should she do? 1

Catching hand not empty Syeda dropped everything! Syeda wants to try again...

  • Pass a plate between hands

  • Put a plate down on the bin

  • Quit

(a)( )

\ | /

  • |

  • |

  • / \

  • / \

 

Syeda can:

  • Pick up a plate from the bin

  • Spin a plate into the air

  • Catch a plate from the air

  • Pass a plate between hands

  • Put a plate down on the bin

  • Quit

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Atharva PatilComputer science

545 Answers

Hire Me
expert
Chrisantus MakokhaComputer science

658 Answers

Hire Me
expert
AyooluwaEducation

835 Answers

Hire Me
expert
RIZWANAMathematics

758 Answers

Hire Me

Get Free Quote!

372 Experts Online