Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

There will be a Gift class with following attributes: order number (combination of letters and numbers), size (values S, M, or L), number of fruits, and price.]

by | Jun 18, 2022 | Java | 0 comments

GET HELP WITH YOUR ESSAY

If you need assistance with writing your essay, our professional Essay Writing Service is here to help!

DISCOUNT CODE FIRST25

ORDER THIS OR A SIMILAR PAPER NOW

I need help properly implementing an array list and display error messages for incorrect input!!!
Design and implement Java program as follows:
There will be a Gift class with following attributes: order number (combination of letters and numbers), size (values S, M, or L), number of fruits, and price.]
There will be two child classes FruitBasket and SweetsBasket with the following additional attributes:
The Gift class hierarchy must provide the following functionality:
There is an ArrayList that holds all the orders generated. It is used to find the order number to change values and to display all entries.
The main () element includes the following functionality:
Your classes must be coded with correct encapsulation: private/protected attributes, and value validation.
FruitBasket: the fee for citrus fruits based on client preference.
SweetsBasket: the fee for bag of nuts based on client preference.
All attribute values can be changed after creation except order number and the values that are calculated or set by the system.
Order is entered by the user. The order either begins with FB or SB and then has three digits after those letters. Must check to be sure the order number is either letter code and only three digits.
When adding a new gift include in the prompt for the order number the pattern used for all orders.
Price is calculated as follows:There is a flat fee of 19.99 for Small gift, 29.99 for Medium gift, and 39.99 for Large gift.
Fruit basket gift has additional fee of 5.99 when it has citrus fruits.
Sweets basket gift has additional fee of 4.49 when it has nuts in it.
Number of fruits in a basket is as follows: Small size has 6 fruits, Medium has 9 fruits, and Large has 15 fruits.
In responding to basket having citrus or nuts there is the option of Yes/No or 1 for yes/2 for no.
Use the uppercase or lowercase function for the values entered. [So that the user can enter either upper or lower case for the size, reviewed the attached Use of Case Letters.docx document.]
Each class must have a method to return or display the class’s values to the console.
On creation [add to ArrayList], a gift order must be given all attribute values except price which must be calculated based on size and option for fruits or bag of nuts.
Instantiation of a Gift class.
Display a menu for selection.
Use a switch.
Order a gift.
The menu should contain:Add a Gift order. The user enters the order number. The order number is checked for letters and numbers. When order number, size, and options are entered, the correct order is added to the Gift array.
Change a gift [Find the appropriate id in the ArrayList and change the size and/or the added citrus or bag of nuts. Recalculate the price.]
Display a single gift order. [Display horizontally with order number, type of gift, size, cost, and specifics about the order. e.g., number of fruits or with citrus or nuts.]
Display all gift orders. [Display horizontally with order number, type of gift, size, cost, and specifics about the order. e.g., number of fruits or with citrus or nuts.]
Exit the program.
It should be considered as a driver, that is, only the minimum number of code lines are in it. Most of the coding is done in methods that are outside of the main () element. The switch should not be considered process coding – no conditionals or other detailed coding – but calls to methods in the program.
There should be appropriate overloading and overriding methods.

GET HELP WITH YOUR ESSAY

If you need assistance with writing your essay, our professional Essay Writing Service is here to help!

DISCOUNT CODE FIRST25

ORDER THIS OR A SIMILAR PAPER NOW

Recent Assignments

How It Works

b

Tell us about your homework assignment.

~

Securely pay for your academic paper

j

Paper gets assigned to an expert tutor

Receive the complete paper via email

Team up With Your Own Writing Expert Now

Stuck with overwhelming assignments? We will take care of all your writing tasks.