Write a program which asks the user to enter the number of ducks, dogs, cats and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
Python Get input from the user numducks intinputEnter the number of ducks numdogs intinputEn... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Cost of goods available for sale consists of two elements: beginning inventory and: (a) ending inventory. (b) cost of goods purchased. (c) cost of goods sold. (d) All of the answer choices are...
-
Explain the difference between transaction exposure and translation exposure using the material in the Caterpillar case to illustrate your answer.
-
Compare and contrast the physical and chemical conditions on Earth at the time life first arose with conditions today. From a physiological standpoint, discuss at least two reasons why animals could...
-
a. For the allowed energies of a particle in a box to be large, should the box be very big or very small? Explain. b. Which is likely to have larger values for the allowed energies: an atom in a...
-
During the past year, the high and low use of three different resources for Fly High Airlines occurred in July and April. The resources are airplane depreciation, fuel, and airplane maintenance. The...
-
A firm faces the following inverse demand curve: = P 500 0.25Q Where: Q is the monthly production P is price, measured in dollars per unit. The firm also has a total cost (TC) function of: TC = 200Q....
-
The proposed rates were not in the range the CEO expected given the pricing analysis. The CEO has asked the pricing actuary to verify the total projected loss cost excluding potential large storm...
-
There are various types of individual disability policies, each defined by the benefits it offers. One type of disability policy is the guaranteed issue policy. Few insurers offer guaranteed issue...
-
When expanding into foreign markets, explain the advantages and disadvantages of the IJV and WOS options when considering your mode of entry.
-
People are often legally required to purchase home and auto insurance. Which BEST explains why this is the case? A. Most people have houses and cars. B. The government needs to prop up these...
-
You will design a fourbar linkage to move the coupler AB from position A1B1 to A2B2 as shown below using the analytical synthesis method with the second strategy. A1 B1 A2 B2 A1: (0, 0) B1: (200,...
-
The accompanying graph shows the relationship between the average annual increase in the price level and the average annual increase in money supply across eight countries. a. What concept, related...
-
Assume that you are trying to determine the optimal contract length for your firm. You know the following information: Marginal Benefit of the Contract is fixed at: $981 Marginal Cost of the Contract...
-
a. Which is longer, an O-H hydrogen bond or an O-H covalent bond? b. Which is stronger?
-
You are thinking of investing in one of two companies. In one annual report, the auditors opinion states that the financial statements were prepared in accordance with generally accepted accounting...
-
739 apples are to be packed and shipped such that 54 are placed in a box. By typing one line (command) in the Command Window, calculate how many apples will remain unpacked if only full boxes can be...
-
The stress intensity factor K predicts the stress state (stress intensity) near a crack tip. F or a plate with a crack and loading shown in the figure, K is given by: Determine K for the case where ...
-
The position x as a function of time of a particle that moves along a straight line is given by: x(t) = (-3 + 4t)e-0.4t ft The velocity v(t) of the particle is determined by the derivative of x(t)...
-
Summer and winter constellations are different because (a) of the spin of Earth about its polar axis. (b) the night sky faces in opposite directions in summer and winter. (c) of the tilt of Earths...
-
The longest-lived stars are those of (a) low mass. (b) high mass. (c) intermediate mass. (d) infinite mass.
-
What is the star nearest Earth? (a) Proxima Centauri (b) Polaris (c) Mercury (d) the Sun
Study smarter with the SolutionInn App