Question: Write a program which asks the user to enter the number of ducks, dogs, cats and flamingoes. Assuming ducks and flamingoes have 2 legs
Write a program which asks the user to enter the number of ducks, dogs, cats and flamingoes. Assuming ducks and flamingoes have 2 legs and no tails while dogs and cats have 4 legs and a tail, determine the total number of legs and tails as shown below. Your output must match the sample run exactly. Sample runs: Enter the number of ducks: 3 Enter the number of dogs: 4 Enter the number of cats: 5 Enter the number of flamingoes: 2 You have a total of 46 legs and 9 tails Enter the number of ducks: 0 Enter the number of dogs: 0 Enter the number of cats: 0 Enter the number of flamingoes: 1 You have a total of 2 legs and O tails
Step by Step Solution
There are 3 Steps involved in it
Python Get input from the user numducks intinputEnter the number of ducks numdogs intinputEn... View full answer
Get step-by-step solutions from verified subject matter experts
