Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a Argo UML of the code and then generate a java code based on that argouml. Create a Candy class with the following attributes:
Create a Argo UML of the code and then generate a java code based on that argouml. 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. getTotalPurchased : 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 Chocolate Checabaterxetaste 3.99 Gummy Gummyhorms 1.15 Gummy AirHeads .99 Vanilla Vanilla Peanuts 1.19 EOF from the main() method you will call a method that will display all of the information for 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started