Question: Need help with this c++ problem Write a function int numLegs(char animalsl. int numAnimals). It should take the array animals, which will consist only of
Need help with this c++ problem

Write a function int numLegs(char animalsl. int numAnimals). It should take the array animals, which will consist only of the chars 'c' and'd' representing "cow" or "duck" and calculate the total number of legs those animals have (assume no mutations or industrial accidents... a cow has 4 and a duck has 2). Note that the function is declared above main but you will implement it at the bottom of the code (after loops have been disabled). Code: 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
