3giez4
28.07.2020 •
Computers and Technology
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
Solved
Show answers
More tips
- G Goods and services How to Choose a Humidifier? Helpful Tips and Recommendations...
- W Work and Career What is the Most In-Demand Profession in the Modern World?...
- A Auto and Moto How Can Parking Sensors Help Drivers?...
- H Health and Medicine What is the Normal Blood Sugar Level in a Healthy Person?...
- F Food and Cooking Red Caviar: How to Choose the Best?...
- C Computers and Internet Clearing Cache: How to Speed Up Your Browser...
- S Style and Beauty How are artificial nails removed?...
- S Style and Beauty Secrets of Tying a Pareo: 5 Ways...
- F Food and Cooking Everything You Need to Know About Pasta...
Answers on questions: Computers and Technology
- C Computers and Technology What is the issue with this code interface Box2{ static final int ITEM_CODE=201; int method1(); double method2(); } public class Window implements Box2{ public int method1(){...
- C Computers and Technology HOMEWORK: Bud, Not Buddy I NOTICE... What do you see? chpter 3-4...
- M Mathematics If a = (8.4∠39°) and b = (5.2∠50.4°), find the product a·b and the quotient a/b...
- S Social Studies Copernicus argued that the planets revolved around the __...
- H History Which statement best describes who controlled central and south america...
- B Business James perkins wants to have a million dollars at retirement, which is 15 years away. he already has $200,000 in an ira earning 8 percent annually. how much does he need...
- S Social Studies Is a term that refers to a code or moral system that provides criteria for evaluating right or wrong?...
- B Business Lena frequently agrees with the rest of her team in hopes that she will be accepted by her team members. she may lose control of her attitude due to...
- C Computers and Technology Which type of connection to the internet is capable of the fastest transfer rates...
- M Mathematics The scores of 1000 students on a standardized test are normally distributed with a mean of 50 and a standard deviation of 5. what is the expected number of students who...
Ответ:
The Option C shows the y-coordinate of the Point C: 7
The Point C is (-2,7)
Step-by-step explanation:
The area of a triangle can be calculated with this formula:
Where "b" is the base and "h" is the height.
We know that the segment AB, of 5 units long, is on the line , which is a horizontal line.
The point C is on the line , which is vertical.
Then we can say that:
Substituting the area and the lenght of the base into the formula and solving for "h", we get:
Then, the height (or the segment BC) of the triangle (Observe the figure attached) is 5 units long.
Therefore, the point C is: (-2,7)
And the y-coordinate of the point C is: 7