Overview For this semester, you will be doing a number of labs and projects usin
ID: 3638548 • Letter: O
Question
OverviewFor this semester, you will be doing a number of labs and projects using the same class over and over again. You’ll be using it for labs/projects like a linked list of objects, stack of objects, queue of objects, tree of objects. Some of the projects will be like maintaining a database of objects where you will interact with the user to add, update, and delete from the database.
Instead of you being forced to do a specific class, you can create your own class as long as it isn’t a Rectangle, Cube, Car, Coin, or Circle (or Butt)
The class you create must have at least 2 attributes, you need at least 1 constructor that will receive at least 1 parameter, you need setters and getters for each of the fields where applicable *remember how the Car class had a getSpeed() but didn’t have a setSpeed() - it had brake() and accelerate() ]
If you can’t think of a good class and are lost as to what to do, here is an example:
Cheese class with attributes a String of cheeseType and a double of cheesePrice. The constructor would receive parameters newCheeseType and newCheesePrice. The methods would be getCheeseType(), getCheesePrice(), setCheeseType(), setCheesePrice()
Project Details
For this review project, you are to create a Class of your own choosing (other than Rectangle / Cube / Car / Coin / Circle / Butt) and use that class
You are to:
? prompt the user for the attributes (Scanner or JOptionPane)
? create the object in memory using the user’s input
? Display the attributes from the object using the getters.
A Sample Run (using Cheese class):
Enter the type of cheese: Cheddar
Enter the price of the cheese: 1.99
Cheese type: Cheddar
Cheese price: 1.99
Press any key to continue . . .
Grading Rubric for your Class file [ ClassName.java ]: (50 Points)
? Comment in program with name (2 points)
? following the naming guidelines for Classes and identifiers (8 points)
? At least 2 class fields created as requested (5 points)
? At least one Constructor created as requested receiving parameters (5 points)
? setter/getter methods as appropriate (20 points)
? proper indenting (methods indented inside class, statements indented inside method) (5 points)
? organization of your Class( instance variable up top / Constructor / setters/getters ) (5 points)
? -3 points if program does not compile and -1 point for each syntax error
Grading Rubric for driver file [ Project1.java or ClassNameDriver.java or something ]: (50 Points)
? prompting the user (Scanner or JOptionPane) for the attributes of the object(10 points)
? Creation of object in code (5 points)
? Displaying values from object using the getters (15 points)
? Comment in program with name (2 points)
? following the naming guidelines for Classes and identifiers (8 points)
? proper indenting (5 points)
? organization of your code(Get/Calc/Display) (5 points)
? -3 points if program does not compile and -1 point for each syntax error