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
Step: 1
Python Get input from the user numducks intinputEnter the number of ducks numdogs intinputEn...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 StartedRecommended Textbook for
Matlab An Introduction with Applications
Authors: Amos Gilat
5th edition
1118629868, 978-1118801802, 1118801806, 978-1118629864
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App