Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume that cheetahs weigh 71 pounds and penguins weigh 67 pounds. Given variables numCheetahs and numPenguins that are read from input, compute the average weight
Assume that cheetahs weigh 71 pounds and penguins weigh 67 pounds. Given variables numCheetahs and numPenguins that are read from input, compute the average weight and assign averageWeight with the result.
Ex: If the input is 8 14, then the output is:
Average weight: 68
(IN C++)
Jump to level 1 Assume that cheetahs weigh 71 pounds and penguins weigh 67 pounds. Given variables numCheetahs and numPenguins that are read from input, compute the average weight and assign averageWeight with the result. Ex: If the input is 814 , then the output is: Average weight: 68 averageWeight is the sum of all the weights divided by the number of animals. Thus, averageWeight is the sum of (numCheetahs * cheetahWeight) and (numPenguins * penguinWeight) divided by (numCheetahs + numPenguins). Ex: If the input is 814 , then ((871)+(1467))/22 yields 68. Not all tests passed. 1: Compare output Output differs. See highlights belowStep 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