Write a program in C++ to help Buddy (the sheepdog) calculate the average age of all his sheep. The program will accept as many ages as Buddy needs to input. The program should help Buddy minimize input errors by error-checking the age for him (everybody knows the maximum age for cartoon sheep is 9 years old). When Buddy’s sheep start to get old, he needs to breed more sheep. So, the code should also let Buddy know if the average age indicates if his sheep are aging, young, or middle-aged based on the chart below: average Sheep Age Population is… <= 3 Young 4 - 6 Middle-aged > 6 Aging
Write a program in C++ to help Buddy (the sheepdog) calculate the average age of all his sheep. The
program will accept as many ages as Buddy needs to input. The program should help Buddy
minimize input errors by error-checking the age for him (everybody knows the maximum age for
cartoon sheep is 9 years old). When Buddy’s sheep start to get old, he needs to breed more
sheep. So, the code should also let Buddy know if the average age indicates if his sheep are aging,
young, or middle-aged based on the chart below:
average Sheep Age Population is…
<= 3 Young
4 - 6 Middle-aged
> 6 Aging
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images