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 

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

1 Expert Approved Answer
Step: 1 Unlock

Python Get input from the user numducks intinputEnter the number of ducks numdogs intinputEn... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!