Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( ) A farmer is asking you to tell him how many legs can be counted among all his animals. The farmer breeds three species:
A farmer is asking you to tell him how many legs can be counted among all
his animals. The farmer breeds three species:
chickens
legs
cows
legs
pigs
legs
The farmer has counted his animals and he gives you a subtotal for each
species. You have to implement a function that returns the total number of
legs of all the animals.
Examples
Plain Text
animals
animals
animals
Notes
Don't forget to
return
the result.
The order of animals passed is
animalschickens cows, pigs
Remember that the farmer wants to know the total number of legs and not
the total number of animals.
Step 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