Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help Link for existing code: https://www.chegg.com/homework-help/questions-and-answers/fruit-make-change-s-necessary-class-work-correctly-completed-test-harness-public-class-fru-q34759653 Lab 04 Instructions.pdf (SECURED)-Adobe Reader File Edit View Window Help 66796 | Tools Fill 8 Sign Comment This

Please help

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

Link for existing code:

https://www.chegg.com/homework-help/questions-and-answers/fruit-make-change-s-necessary-class-work-correctly-completed-test-harness-public-class-fru-q34759653

Lab 04 Instructions.pdf (SECURED)-Adobe Reader File Edit View Window Help 66796 | Tools Fill 8 Sign Comment This lab requiras you to make code dhange to support irpiementing an interface Review the rexrs material regarding Interfaces betore beginning- Your users have asked you to begin building a shopping cart system for a grocery store. Right now, there arent many classes to be included in the application, bur these few classes (in unrelated hierarchies) s all be able to calculate an extended price and ust all have access t0 the local sales tax rone. You wil need to make dhanges in classes Produce, Fruit,vegetable, and Giftcard so support tho Interface Rineout (provided tou You will also need to add two lines of code to the test harness Test Labe4. Given UML describing the dasses and interface A zipped folder containing: Complete cod0 for the RingOut martoceDO NOT CHANGE THIS CODE Staring point code for the following clanes: * o Produce o Fruit o Vegetable o Giftcard A test harness: Test Labe4, you will need to make modifications to this Expected output from the test harness Task Requirements Ringout The somplete interface code has been provided to you. This interface includes one attribute, taxRate, which will be available 10 all objecs inglemerting the interface. I also idudes a default method, chkTaxable, with a concrete definition provided. The availability of defodt methods in interfaces is an enhancement new to SE8 of Java. You will moke ne channes to the interface code. Produce The Produce cless must be modified to use the interface Ringout. No interface metheds need defined in is dass. so be I3 2041 Lab 04 82019 Terri Davis Spring 2019 9:11 PM O Type here to search Lab 04 Instructions.pdf (SECURED)-Adobe Reader File Edit View Window Help 66.7% Tools Fill 8 Sign Comment Fruit You will need to provide code to support the Ringout interface. Make no other changes in the dass Vegetable You will need to provide code to support the Ringout interface. Make no other changes in the dass GiftCard Modify the Giftcard class to use the RingOut interface. You will need to provide code to suppor the interfoco. Make no other dhanges in the doss. Test Labe4 Mak the necessary danes to ta test harness: 1. Declare an array no hold 4 objects of mixed types/dasses implementing thRingout interface. Do not move the dedaration from where it has been started Write the enhanced for loop control shatement to procoss tearray. Do not change the body ot the loop as provided Testing Your test resdts should exacfly match those provided Submitting Your Work Create a zipped folder containing five (5) source modules. Produce.java Fruit.java - Vegetable.java GiftCard.java Test Labe4.java Submit the sipped folder through Blackboard for this lab assignmenn O Type here to search 9:11 PM 2/9/2019 2 Lab 04 UML Diagrams.pdf (SECURED) - Adobe Reader File Edit View Window Help 68.3% |- Tools Fill 8 Sign Comment Sign In Export PDF Adobe ExportPDF Convert PDF files to Word or Excel online. Select PDF File: Produce implements RingOut Attributes private product Contains the name or type ot Produce Operations Lab 04 UML Diagrams.pd public public public toStringl ):String Produce 1 file/415 KB ype Produce Ful Returns a formatted String The Lass item is Convert To: Microsoft Word (docx) Recognize Text in English(U.S.) Change Convert - Create PDF Edit PDF Combine PDF Send Files Store Files Produce [C) 2019 Terri Davis IS 2041, Spring 2019 Lab 04 9:11 PM 2/9/2019 O Type here to search rP ^ 41) Lab 04 UML Diagrams.pdf (SECURED-Adobe Reader File Edit View Window Help 68.3% |- Tools Fill 8 Sign Comment Sign In Export PDF Adobe ExportPDF Convert PDF files to Word or Excel online. Select PDF File: Vegetable extends Produce Attributes private price: double Price per pound of fruit Lab 04 UML Diagrams.pd Operations 1 file/415 KB able vegetable( type: String. Null constructor doubla: prc Convert To: double: cnt ) Microsoft Word (docx) toStringl J: String Returns a formatted String The nameofcLass 1tem is product. The price is sprice each for count Extended Price: calcExtendedPrice. Recognize Text in English(U.S.) Change NOTES Convert calcExtendedPrice is an abstrect method of the inherited interface R - Create PDF Edit PDF Combine PDF Send Files Store Files Vegetable (c) 2019 Terri Davis IS 2041, Spring 2019 Lab 04 9:12 PM 2/9/2019 O Type here to search rP ^ 41) Lab 04 UML Diagrams.pdf (SECURED-Adobe Reader File Edit View Window Help 45 68.3% |- Tools Fill 8 Sign Comment Sign In Export PDF Adobe ExportPDF Convert PDF files to Word or Excel online. Select PDF File: GiftCard Lab 04 UML Diagrams.pd acardwha:tring 1 file/415 KB tain:tring Convert To: Microsoft Word (docx) Recognize Text in English(U.S.) Change Convert - Create PDF Edit PDF Combine PDF Send Files Store Files 20AL, Saring arus 9:12 PM 2/9/2019 O Type here to search rP ^ 41) Lab 04 UML Diagrams.pdf (SECURED-Adobe Reader File Edit View Window Help 68.3% Tools Fill 8 Sign Comment Sign In Export PDF Adobe ExportPDF Convert PDF files to Word or Excel online. Select PDF File: RingOut Attributes Rate: double The local sales tax rate Operations Lab 04 UML Diagrams.pd Returns a boolean value indicating wether a particuler object is taxable, true for taxable folse for non taxable Abstract defintion of interface method concrete definitions will return a double value defoult chkTaxable: boolean 1 file/415 KB alcE double the extended price of an item. Convert To: Microsoft Word (docx) Recognize Text in English(U.S.) Change Convert - Create PDF Edit PDF Combine PDF Send Files Store Files RingOut [C) 2019 Terri Davis IS 2041, Spring 2019 Lab 04 O Type here to search 9:12 PM 2/9/2019 2 Lab 04 Expected Output.pdf (SECURED)-Adobe Reader File Edit View Window Help 68.3% |- Tools Fill 8 Sign Comment Expected Output The next iten is not taxable The Fruit iten is Strawberry. The price is $2.56 per pound and the amount is 1.33 pounds Extended Price: $3.40 The next iten is not taxable The Vegetable item is Cucumber. The price is $0.45 each for 3. Extended Price: $1.35 The next item is taxable at a rte of 8.0825% The GiftCard to Amazon has a value of $100.0. The total cost is $188.25, including tax The next iten is not taxable The Fruit iten is Blackberry. The price is $4.18 per pound and the anount is 0.88 pounds Extended Price: $3.68 The next iten is not taxable The Vegetable item is Bok Choy. The price is $1.98 each for 2 Extended Price: $3.96 The next item is taxable at a rte of 8.0825% The GiftCard to Barnes & Noble has a value of $5.00. The total cost is $54.13, including tax O Type here to search 9:11 PM 2/9/2019

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

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

How is economics used as a policy tool?

Answered: 1 week ago