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 23:00
Explain briefly why you cannot expect to find a previous version of every file with which you work.
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is [email protected] -
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Which component acts as a platform on which application software runs
Answers: 2
question
Computers and Technology, 23.06.2019 21:40
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
You know the right answer?
In order to manage their illness, people with Type 1 Diabetes need to calculate the carbohydrates in...
Questions