Question: ChewingGum.java /** * Chewing Gums * Chewing gum (or gum, bubblegum) is a chewy candy. Some are easy to blow bubbles with. * Examples: Wrigley's

 ChewingGum.java /** * Chewing Gums * Chewing gum (or gum, bubblegum)

is a chewy candy. Some are easy to blow bubbles with. *

Examples: Wrigley's Chewing Gum, Hubba-Bubba */ public class ChewingGum extends CandyPiece {

ChewingGum.java

/** * Chewing Gums * Chewing gum (or gum, bubblegum) is a chewy candy. Some are easy to blow bubbles with. * Examples: Wrigley's Chewing Gum, Hubba-Bubba */

public class ChewingGum extends CandyPiece { private String flavor;

publicChewingGum(String name, intkcal, String flavor) { super(name, kcal); this.flavor = flavor; }

}

Chocolate.java

/** * Chocolate * Chocolate is made with CoCoa beans and milk. It is oftentimes mixed with a lot of other ingredients. * Examples: Milka, Hershey, Snickers, Butterfinger, M&Ms, Kit Kat, Chocolate Covered Raisins, ... */

public class Chocolate extends CandyPiece { private String mixIn; public Chocolate(String name, int kcal, String mixIn) { super(name, kcal); this.mixIn = mixIn; } }

(1) Create files to submit: Main.java -Contains main() method Candy.java Candy Piece.java Chewing Gum.java Chocolate.java (2) You are getting ready to keep track of Halloween candy consumption. Specifically, you are to keep track of calories as you eat the candy after you went door-to-door. Ex: How many candy do you have? Candy 1 Enter the type of Candy: Chocolate Enter the Candy name: Kit Kat Enter the Mix-in: Nuts Enter the Candy Calories: 218 Enter the item quantity: Candy 2 Enter the type of Candy: Chocolate Enter the Candy name: Butter Finger Enter the Mix-in: Marbles Enter the Candy Calories: 275 Enter the item quantity: Candy 3 Enter the type of Candy: chewing gum Enter the Candy name: Trident Enter the Flavor: Orange Enter the Candy Calories: Enter the item quantity: (3)Add the calories of the items together and output the individual and total calories. Total Calories: Kit Kat 2 @ 218 - 436 Butter Finger 1 @ 275 - 275 Trident 5 @ 18 - 90 Total: 801 calories

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!