subject

In order to manage their illness, people with Type 1 Diabetes need to calculate the carbohydrates in the foods they eat so that they can then inject the correct amount of insulin to process the food. Any food with less than 1 gram of carbohydrates per serving can legally be called "zero carb" A diabetic can eat any amount of zero carb foods.
Make a subclass Food of the Product class you'll find in the starter code. Besides the description and price inherited from Product, Food also has an instance variable carbs (a double). Do not redefine price and description variables. Call the super class to initialize them
Food has methods:
public double getCarbs()
public boolean isZeroCarb() which tells if this Food can be considered zero carb. A Food is considered zero carb if it has less than 1 gram of carbohydrates per serving. Return true if the Food is zero carb. Otherwise, return false.
public String getDescription() overrides the getDescription method in Product to also include the number of carbs. Call the getDescription method in the super class and add the new information on the end. The return string will look like this: spinach carbs=0.2

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Which one of the following identifies the primary a purpose of information classification processes? a. define the requirements for protecting sensitive data.b. define the requirements for backing up data.c. define the requirements for storing data.d. define the requirements for transmitting data.
Answers: 2
question
Computers and Technology, 22.06.2019 12:30
An atom's diameter is about 0.1 nanometer (1×10-9m), and a human hair is about 1×10-3m. how many times greater is a human hair than an atom's diameter? sorry pushed wronf button but this is math
Answers: 3
question
Computers and Technology, 22.06.2019 14:20
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
question
Computers and Technology, 22.06.2019 16:30
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
You know the right answer?
In order to manage their illness, people with Type 1 Diabetes need to calculate the carbohydrates in...
Questions
Questions on the website: 13722367