Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

non-graded exercises, discussions, and assignments to date. There is only one java file for all the coding of this assignment allowed. Multiple java files are

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
non-graded exercises, discussions, and assignments to date. There is only one java file for all the coding of this assignment allowed. Multiple java files are not acceptable. Design and implement Java program as follows: 1) There will be a Gift class with following attributes: order number (combination of letees[2] and numbers[3]), size (values S for Small, M for Medium, or L for Large), number of fruits, and price.] 2) There will be two child classes EruitRasket and Sweets Bosket with the following additional attributes: - EnitBasket: the fee for adding citrus fruits based on client preference. - SweetsBasket: the fee for additional bag of nuts based on client preference. 3) The Gift class hienarchy must provide the following functionality: - All attribute values can be changed after creation except order number and the values that are calculated or set by the system. - An order id is entered by the user. The order either begins with FB or SB and then has three number characters after those letters. Must check to be. sure the order id is either letter code [FB or SB] and only three number characters. - When adding a new gift include prompts for the size and adding preference or not to the order id with citrus for FB and nuts for SB. - Price is calculated as follows: - There is a flat fee of 19.99 for Small gitt, 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 backet gitt 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 bas 9 fruits, and Large has 15 fruits. - In responding to basket having cittus of nuts there is the option of Yes/No or 1 for yes/2 for no. - Use the upperease 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 doce document.] - Each class must have a method to refurn or display the class's values to the console, 4) There is an Amavlist that holds all the orders generated. It is used to find the order id to change size or preference of an order. 5) The main 0 element includes the following functionality: - On creation [add to dmwlist, a gift order must be given all attribute values exeept price which must be calculated based on size and preference option for citrus fruits or bag of nuts. - Instantiation of a Gift class. - Display a menu for selection. - Use a switch. - Order a gift. - The menu sbould contain: 0. Add a Gift order. The user enters the order id. The order id is cheeked for letters and numbers. When order number, size, and preference options are entered, the correct order is added to the Gift array with the price. Change a gift [Find the appropriate id in the Amevlist and change the size and/or the added citrus or bag of nuts. Recalculate the price.1. 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 additional citrus fruit or nuts. 1 - Display all gift orders. [Display borizontally with order number, type of gift, sine, cost, and specifics aboat the order. e.g, number of fruits or with additional citrus fruit or nuts.] Ealt the program. - It should be considered as a driver, that is, only the minimam number of code lines are in it. Most of the coding is done in methods that are outside of the main 0 elemen. The swich should not be considered process coding - no conditionals or other detailed coding - but calls to methods in the promram. 6) Your classes must be coded with correct encapsulation: private/protecied attributes, and value validation. 7) There thould be appropriate overlonding and overriding metheds. Style and D ocsmeatation: Make iure your Java progam is wing the roconvended style iuch ars - Javadoe comment up froot with your nanse as authoe dase, and hrief purpose of the prognam. - Comments for variables and biocks of code to describe major finctionality (refer to the Documentatioe of Trograms found in Weck 1). - Meaningful varisble names and prompts - no single charde fer that is meaningles. - Class names are written in upper CaraelCave. - Constants are writies in All Capiale - Use proper spacing and empky lines to make code maee uererfrimally. readable. CMisp4) Avserment? Fin)12 Capture execution: You should capture and label screen captures associated with compiling your code and running a passing and failing test cases for each functionality. Sample run 1: MENU 1: Order a Gift basket 2: Change Gift sasket 3: Display Gift basket 4: Display all Gift Baskets 9: Exit progran Enter your selection: 3 No Bift has been ordered yet MENU 1: Order a 61ft basket 2. Change 61ft Basket 3: Display 61ft lasket 4. Display all 6ift Baskets 9: Exit progran Enter your selection: 9 Thask you for uslog the progran, Coodbye! Sample run 2: Mewy 11) order a Gift sasket 2i: Change Gift lasket 3: Display Gift Basket 4. Oisplay all Gift earkets 5: Ixit progran Enter youe selection: 2 No Lift as been orcered yet Sample run 3: nEN 1: order a Gift basie: 2: Chance 6ift busket 3t oisplay Gift basket 4. Display all Gift buskets 9i txit procras Enter your selectlonz 1 CMisz42: Awigament 2. rax=13 sprine 2023 Do you want Fruit Basket (1) or Sweets Basket (2):1 Create order number [FB or SB for type of gift and three integers] FB343 What size do you want: 5,M, or L:S Do you want citrus fruits included? 1 for yes/2 for no: 1 MENU 1: Order a 61ft Basket 2: Change Gift Basket 3: Display 61ft Basket 4: Display all Gift Baskets 9: Exit progran Enter your selection: 3 Order Nunber: FB343 F8343: A sna11 Ecuitaasket with 6 Fruits with citrus costing \$25.98] MENU 1: Order a Gift Basket 2: Change Gift Basket 3: Display Gift Basket 4: Display all Gift Baskets 9: Exit progran Enter your selection: 2 Which 6 ift do you want to change? FB343 Current glft size is: Small What size do you want [enter saae size or one of order sizes]? M Current basket contains citrus. Do you want citrus fruits included? 1 for yes/2 for ao: 2 New order is FB343: A nediun Ecuitllasket, with 9 Fruits with no citrus costing $29.99 MENU 1: Order a 6ift Basket 2: Change Gift Basket 3: Display 61ft Basket 4: Display a11 6ift Baskets 9: Exit progras Enter your selection: 3 FB343: A mediun Ecutillasket, with 9 Fruits with no citrus costing $29.99 MENU 1: Order a Gift Basket 2: Change Gift Basket 3: Oisplay Gift Basket 4: Display a11 Gift Baskets 9: Exit progran Enter your selection: 9 Thank you for using the prograt. Goodbyet Deliverables inclede a single dava pregrae (java) and a iingle Word (er P DF) decument. No thped files are acceptalle. The fave abd WordP DF files a hould be named aparopriately for the Though you might ceetruct the assipntieat with multiple classes, the fital submisrioe muat de a single lava pregram. The process of combinitge mealtiple elasses into a single lava program is found in Week 1 Cotsent under the Practice Exenche thread and btled Practice Axercise as ONE Jova pregras. Submit the combined lave program as the ataehment for Assigameat 2 , The wond (or ? Dr ) decement ihould inclode a Ten Plan with moltiple tert cases. All teat cases are lised in the table that dinplays the variour elemeats of a proceus. Each teut case showld be referenced to s iceeen captare thowiag the saccesfel compiling asd natist of eath of the init ta11. Each scren eapeure ihould be properly labeled elewly indicated what the ictren capter trpenent. It is mesented that the teat table inclide these columane: - Teat Case fi - Mesa Selectien - Type of Basket - Over Number - Sure (5, M, L.) - Nuus added - Carna added - Cost - Proceaing Command( (1) - Meauges for entin and eler inforation to the uaer 5ubmit your files to Autignisent 2 foldor robeiniso area no later than be dive date linted in your oolipe claureen. Calculation Table

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

Students also viewed these Databases questions

Question

How will you establish groups?

Answered: 1 week ago