Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design and implement Java program as follows: {1} There will be a 6:}? class with following attributes: order number {combination of numbers and letters}, size

image text in transcribedimage text in transcribed
Design and implement Java program as follows: {1} There will be a 6:}? class with following attributes: order number {combination of numbers and letters}, size (values 3, M= or L), number of fruits, and price. {2} There will be two child classes Fmttasket and StvserSBasksr with the following additional attributes: II FruitBasket: the fee for citrus 'uits based on client preference. II SweetsBasket: the fee for bag of nuts based on client preference. [3} The Gift class hierarchy must provide the following finictioilality: II On creation [add to ArrayList], a gift instance must be given all attribute values except price which must be calculated based on size and option for fruits or bag of nuts. II All attribute values can be changed after creation except order number and the values that are calculated or set by the system. I Order is entered by the user. The order either begins with FE or SB and then has three digits after those letters. Must check to be sure the order number is either letter code and onlythree digits. II When adding a new gi include in the prompt for the order number the pattern used for all orders. II Price is calculated as follows: o There is a at fee of 19.99 for Small gi, 29.99 for Medium gib and 39.99 for Large gift. 0 Fruit basket gift has additional fee of 5 .99 when it has citrus uits. o Sweets basket gi has additional fee of 4.49 when it has nuts in it. II Number of nds in a basket is as follows: Small size has I5 fruits, Medimn has 9 'uits= and Large has 15 fruits. I In responding to basket having citrus or nuts there is the option of Yesr'No or 1 for year? for no. I' Use the uppercase or lowercase mction for the values entered. 0 ln responding to basket having citrus or nuts there is the option of Yesr'No or 1 for yes? for no. Use the uppercase or lowercase Jnction for the values entered. Each class must have a method to return or display the class: 5 values to the console {4} The main 0 element includes the following mctionahty: lnstantiation of a Gift class. Display a menu for selection. Use a switch. Order a gift. Change a gift [Find the appropriate id inthe ArrayList and change the size andfor the added citrus or bag of nuts. Recalculate the price.] Ir Display a single gift. [Display horizontally with order number, type of gi, size= cost, and specifics about the order. e. g., number of fruits or with citrus or nuts] 0 Display all gis. [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. i It should be considered as a driver, that is, onlythe minimum number of code lines are in it. Most of the coding is done I methods that are outside of the main CII element. The switch should not be considered process coding no conditionals but calls to methods in the program. [5} There is an ArrayList that holds all the orders generated. It is used to nd the order number to change values andto display all entries. [6} Your classes must be coded with correct encapsulation: privatei'protected attributes= and value validation. {7"} There should be appropriate overloading and overriding methods

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

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

Financial and Managerial Accounting

Authors: Carl S. Warren, James M. Reeve, Jonathan Duchac

12th edition

978-1133952428, 1285078578, 1133952429, 978-1285078571

Students also viewed these Mathematics questions

Question

Repeat Problem 1.3 for a core permeability of = 1300 0.

Answered: 1 week ago