Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this assignment please!!!! Verizon 7:02 PM 65% iiii--+ CSE 205 Assignment a CSE+205+Assignment+1 CSE 205: Object Oriented Programming Assignment 1 Overview

I need help with this assignment please!!!!
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Verizon 7:02 PM 65% iiii--+ CSE 205 Assignment a CSE+205+Assignment+1 CSE 205: Object Oriented Programming Assignment 1 Overview In this assignment you will write a program that will simulate a storage area with collections of items. Items can be added, removed, and the user can check the value of an item. This assignment does not cover any new material, but is meant to give you a chance to freshen your skills from CSE 11 Requirements Your program must do the following in order to receive full credit on this assignment I. Create a class called Item a. Each Item has a name and a value in cents These cannot be public Write a default and a regular constructor b. 2. a. The regular constructor should take arguments for both instance variables 3. Write a get for name. 4. Write a method which returns the value of the item in dollars and cents a What type should this method return? 5. Write a class called Shelf which has an array of items a. It should also track the number of Items currently on this shelf b. Define the maximum number of Items as a constant which is equal to five a All shelves start off empty a. It should return true if it was added, false if it was not 6. Write a single default constructor 7. Write a boolean method that attempts to add a given Item (in the parameter) to this shelf b. A new Item can't be added if the shelf is full 8. Write a method that returns a String array containing all the names of the Items on this shelf This does not report empty spaces, so if there are only two Items on this shelf, the array will be 2 long a. b. Return a 0 length array if the shelf is empty 9. Write a method which accepts a String for the name of an Item on this shelf and return the dollar and cents value of the Item a. You can assume Items do not have a negative value, so return a negative value if an Item with that name is not found Verizon 7:02 PM 65% iiii--+ CSE 205 Assignment a 10. Write a boolean method that accepts the name of an Item as a parameter and tries to remove it from this shelf It can't be removed if it's not on the shelf Hint: For this and the previous step, you may want a private helper method to do some common functionality between the two. a 11 Create your main driver class which will contain your main method a. You will be using Scanner in multiple methods. To prevent issues with multiple Scanners, you should create only one and only close it once at the end of the program What does the Scanner object need to be for that to work? 12 Create a method which prints out the main menu to the user, accepts their choice, verifies E. that they selected a valid option, and then returns it a. Add an Item b. List all Items c. Check the value of an Item d Remove an Item e. Quit 13. Write a method which creates and returns a new Item. a You will need to ask the user what the name and value of the Item is 14. Create your main method which creates an array of 3 empty shelves and then enters a loop of processing the user's choice from the main menu 15. If the user chose to add an Item, run your method to create a new Item and add it to the first available space on a shelf a. Print which shelf it was added to b. Ifall the shelves are full, print an error message 16. If the user chose to list the Items, then print out the three shelves from the array and which Items are on them in order a If the shelf is empty, print a message that it is empty instead b. See example outputs 17. If the user chose to check the value of an Item, have the user type in the name of the Item in question, then find it and display its value. If the Item doesn 't exist, print an error message You can assume that there are no duplicate Item names a b. 18. If the user chose to remove an Item, have the user provide the name of the Item and remove it from its shelf a. Again, print an error if it's not there Example Inputs ..n Verizon 7:02 PM CSE 205 Assignment a #2 What do you want to do? A. Add an Ite B. List all llems C. Check the Value of an Item D Remove an Iiem E Quit Invalid option What is the Item called Beef What is its value in cents? 321 Beef was added to Shelf I What do you want to do? A. Add an Iem B. List all Ihems C. Check the Value of an Item D Remove an Item E Quit Please enter the name of the Isem Beef Beef is worth $32 What do you want to do? A. Add an Item B. List all llems C. Check the Value of an Item D Remove an Item E Quit Bye #3 What do you want to do? Dashboard Calendar To Do Notifications Inbox ..n Verizon 7:02 PM CSE 205 Assignment a #3 What do you want to do? A. Add an Item B. List all llems C Check the Valuc of an ltem D. Remove an Item E Quit What is the Item called thing What is its value in cents thing was added to Shelf What do you want to do? A. Add an Ie B. List all Ihems C Check the Value of an Item D Remove an Item E Quit What is the Item called? thing2 What is its value in cents? thing2 was added to Shelf What do you want to d? A. Add an Item B. List all ltems C Chock the Valur of an Item D. Remove an Item E Quit Shelf I thing, thing? Shelf 2 is empty Shelf 3 is empty What do you want to do? A. Add an Item B. List all Ihems C Check the Value ofan llem Dashboard Calendar To Do Notifications Inbox ..n Verizon 7:02 PM CSE 205 Assignment... D Remove an Iiem E Quit Please enter the name of the Isem to remove thing thing was removed from Shelf What do you want to do? A. Add an Ite B. List all tems C. Check the Value of an Item D. Remove an Item Shelf I thing Shelf2 is empty Shelf 3 is empty What do you want to do? A. Add an Ite B. List all Iems C Check the Value of an Itenm D. Remove an Item E Quit Bye #4 What do you want to do? A. Add an Item B. List all ems C. Check the Value of an Item D Remove an Item E Quit Please enter the name of the Isem thing thing could not be found What do you want to do? A. Add an Item B. List all Ihems Dashboard Calendar To Do Notifications Inbox ..n Verizon 7:02 PM CSE 205 Assignment... A. Add an Item B. List all ems C. Check the Value of an Item D. Remove an Item E Quit What is the Item called? thing What is its value in cents? thing was added to Shelf What do you want to do? A. Add an t B. List all Ihems C. Check the Value of an Item D. Remove an Item E. Quit Please enter the name of the Iem to remove Thing Thing could not be found What do you want to do? A. Add an Item B. List all Ihems C Check the Value of an Item D. Remove an Item EQuit Bye #5 What do you want to do? A. Add an Item B. List all ems C. Check the Value of an Item D Remove an Item E Quit Whut is the Item called? Dashboard Calendar To Do Notifications Inbox Verizon 7:03 PM CSE 205 Assignment a E Quit What is the ltem called What is its value in cents? a was added to ShelfI What do you want to do? A. Add an Ites B. List all Ihems C Check the Value of an Item D Remove an liem E Quit What is the Iem called? What is its value in cents b was added to Shelfi What do you want to do? A. Add an Item B. List all Iems C Check the Value of an llem D. Remove an Item E Quit What is the Item called What is its value in cents e was added to ShelfI What do you want to do? A. Add an Ie B. List all Ihems C Check the Value of an Item D Remove an Iiem E Quit What is the Item called? Dashboard Calendar To Do Notifications Inbox .11 Verizon 7:03 PM CSE 205 Assignment... What is its value in cents d was added to Shelf I What do you want to do? A. Add an lte B. List all Ihems C Check the Value of an Item D Remove an Item E Quit What is the ltem called? What ts its value cents? e was added to Shelf 1 What do you want to do? A. Add an Item B. List all Ilems C. Check the Value of an Item D. Remove an Item E Quit What is the Item called? What is its value in cents f was added to Shelf 2 What do you want to do? A. Add an lte B. List all Ihems C Check the Value of an llem D. Remove an Item E Quit Shelf I a b, c, de Shelf2 r Shelf 3 is empty What do you want to do? Dashboard Calendar ToDo Notifications Inbox Verizon 7:03 PM KCSE 205 Assignment... Q Shelf 3 is empty What do you want to do? A. Add an Item B. List all ems C. Chock the Value of an Item D. Remove an Item Bye Submission Please submit your Assignmetx java file to the Assignment X link on Canvas under the Assignments section. You may subeit as many times as you waet price to the due date, in case you later find and fix an error, but only the last one is graded Dashboard Calendar To Do Notifications nbox .111 Verizon 7:02 PM 65% CSE 205 Assignment... CSE+205+Assignment+1 CSE 205: Object Oriented Programming Assignment 1 Overview In this assignment you will write a program that will simulate a storage arca with collections of items. Items can be added, removed, and the user can check the value of an item. This assignment does not cover any new material, but is meant to give you a chance to freshen your skills from CSE 11 Requirements Your program must do the following in order to receive full credit on this assignment I. Create a class called Item a. Each Item has a name and a value in cents These cannot be public Write a default and a regular constructor b. 2. a. The regular constructor should take arguments for both instance variables 3. Write a get for name. 4. Write a method which returns the value of the item in dollars and cents a What type should this method return? 5. Write a class called Shelf which has an array of items a. It should also track the number of Items currently on this shelf b. Define the maximum number of Items as a constant which is equal to five a All shelves start off empty a. It should return true if it was added, false if it was not 6. Write a single default constructor 7. Write a boolean method that attempts to add a given Item (in the parameter) to this shelf b. A new Item can't be added if the shelf is full 8. Write a method that returns a String array containing all the names of the Items on this shelf. This does not report empty spaces, so if there are only two Items on this shelf, the array will be 2 long a. b. Return a 0 length array if the shelf is empty 9. Write a method which accepts a String for the name of an Item on this shelf and return the dollar and cents value of the Item a. You can assume Items do not have a negative value, so return a negative value if an Item with that name is not found

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_2

Step: 3

blur-text-image_3

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

6. Identify characteristics of whiteness.

Answered: 1 week ago

Question

9. Explain the relationship between identity and communication.

Answered: 1 week ago