Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Candy Class along with its attributes and fields has to be created in ARGO UML and then then generate a Java code using UML diagaram

Candy Class along with its attributes and fields has to be created in ARGO UML and then then generate a Java code using UML diagaram
image text in transcribed
image text in transcribed
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 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 CandyDriver 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

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

More Books

Students also viewed these Databases questions

Question

What is Ramayana, who is its creator, why was Ramayana written?

Answered: 1 week ago

Question

To solve by the graphical methods 2x +3y = 9 9x - 8y = 10

Answered: 1 week ago

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

What are DNA and RNA and what is the difference between them?

Answered: 1 week ago

Question

Why could the Robert Bosch approach make sense to the company?

Answered: 1 week ago