Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Argo UML of the code and then generate a java code based on that argo uml Create a Candy class with the following

Create a Argo UML of the code and then generate a java code based on that argo uml image text in transcribed
image text in transcribed
Create a Candy class with the following attributes: type : String Example: chocolate, sticky, gum, vanilla name : String Example: "chocolate covered pretzels, airheads, gummy worms pricePerPound : double LOW_PRICE_ITEM: double (this is a constant set to 1.25, representing $1.25 per pound and is a low price item if it is less than or equal to this amount) HIGH_PURCHASE_ITEM: double ((this is a constant set to 2.5#, representing a candy is a high purchase item if it is purchased at more than 2.5 # per purchase) and the following methods: two constructors o the default constructor o an overloaded constructor with the first 3 attributes passed in and assigned. getters and setters for the first 3 attributes a getter for the LOW_PRICE_ITEM This function will return true if the candy object is a low price item. a getter for the HIGH_PURCHASE_ITEM This function will return true if the candy object is a high purchase item. getTotalPurchase(): double - a method to two constructors o the default constructor o an overloaded constructor with the first 3 attributes passed in and assigned. getters and setters for the first 3 attributes a getter for the LOW_PRICE_ITEM This function will return true if the candy object is a low price item. a getter for the HIGH_PURCHASE_ITEM This function will return true if the candy object is a high purchase item. getTotalPurchase(): double - a method to return the total amount of candy purchases, formatting is important .toString() to display the state of the object, What is the name, type and is this a low priced item or high purchased item. Create a Candy Driver in the main() method you will create Candy objects from the data file below, use the overloaded constructor o candy.txt from the main() method you will call a method that will display all of the information for the candys(the formatting of the output of each candy should come from within the toString(). You should check to see if the candy is low priced or a high purchase item

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

More Books

Students also viewed these Databases questions