2.1: Write a Python program does all the following steps. Make sure you label all your...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2.1: Write a Python program does all the following steps. Make sure you label all your print output to explain what you are printing. This is required for all problems in this course. a. Prompts the user to enter a whole number from 1 to 7. No validation required for this problem. b. In one line of code/calculation, performs the following operations on the user supplied number in this exact order: o Multiply by 2 o Add 10 o Divide by 2 o Subtract the user supplied number c. Print the output of this calculation in part 'b' as an integer (no decimal places). d. Now take the same user supplied number from part 'a' and convert it to a three-digit number with incrementing digits. Assign this number to a variable as an integer. o For example, if the user entered '3', the three-digit version is 345. e. Add the three digits together and print the results. o For example, if the user entered 3, you would calculate 3+4+5 = 12. f. Divide the three-digit version by the resulting sum of its digits and print the results as a float. o For example, if the user entered 3, you would calculate 345 / 12. Reprint the output of part 'f' as a truncated integer (no decimal places). g. 2.1: Write a Python program does all the following steps. Make sure you label all your print output to explain what you are printing. This is required for all problems in this course. a. Prompts the user to enter a whole number from 1 to 7. No validation required for this problem. b. In one line of code/calculation, performs the following operations on the user supplied number in this exact order: o Multiply by 2 o Add 10 o Divide by 2 o Subtract the user supplied number c. Print the output of this calculation in part 'b' as an integer (no decimal places). d. Now take the same user supplied number from part 'a' and convert it to a three-digit number with incrementing digits. Assign this number to a variable as an integer. o For example, if the user entered '3', the three-digit version is 345. e. Add the three digits together and print the results. o For example, if the user entered 3, you would calculate 3+4+5 = 12. f. Divide the three-digit version by the resulting sum of its digits and print the results as a float. o For example, if the user entered 3, you would calculate 345 / 12. Reprint the output of part 'f' as a truncated integer (no decimal places). g.
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
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...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
What are the Four Eras of Commercial Aviation Safety in order from the 1950's to the future?
-
Explain the organizational archetypes as described by Mintzberg and discuss how organizational structure influences innovation. Summarize Mintzberg's work with archetypes. What key features and...
-
Which of the following transitions in sodium do not occur as electric dipole transitions? (Give the selection rule that is violated.) 451/2 3S1/2 4D3/23P1/2 4S1/2 3P3/2 4D3/2 351/2 4P3/2 3S1/2 5D3/2...
-
If circulation in boiler made by pump, then it is known as: (a) Natural circulation boiler (b) Forced circulation boiler (c) Internally fired boiler (d) Externally fired boiler
-
Willow Creek Company purchased and installed carpet in its new general offices on April 30 for a total cost of $18,000. The carpet is estimated to have a 15-year useful life and no residual value. a....
-
Level 2 - Calculating Travel Costs at America Travels As a new sales associate at America Travels travel agency, you assist travel agents in finding the best fares for corporate customers. As a...
-
In cell C11, construct a formula to calculate the annual projected street maintenance costs for the year 2025 after the projected increase of 5% is applied. Use absolute cell references as necessary....
-
Why is it vital to have a sound internal control system in the organization? Explain in detail with examples using academic sources.
-
3. The diagram below shows an apparatus for studying the photoelectric (PE) effect. When light of wavelength 620 nm shines on the cathode, electrons are emitted. The current I of electrons that reach...
-
0 47. Feric Problem 1 (18 points). A 5.0-kg crate is placed on a ramp inclined 30 to the horizontal, as shown in Figure 1. (sin 30 = 0.5; cos 30 = 0.87) (a) Draw a Free-Body Diagram of the forces on...
-
A massive explosion occurs on the moon when a large meteor strikes. (a)lf the moon is 384,000 km away, calculate how long it will take us to see the light from the explosion to reach us here on Earth...
-
50.0-Hz AC generator with a peak voltage of 220 V drives a series RC circuit with R = 150 and C = 33.0 F. What is the peak current in the circuit? What is the phase angle?
-
A car moving on a level highway has a mass of 4.0 X 10^ 2 kg. The coefficient of friction between the tires and the highway is 0.19. What acceleration will an applied force of 2250 N produce on the...
-
Tim O'Hare is the distribution manager for Consolidated, Inc. Major builders can order from Consolidated, Inc. two products: door hardware and casters. Since the construction industry goes through...
-
7. FALSE DILEMMA 8. GANDWAGON Definition: Fallacy example: How to revise argument: Definition: Fallacy example: How to revise argument:
-
Leslie and Leon Lazo are married and file a joint return for 2012. Leslie's Social Security number is 466-47-3311 and Leon's is 467-74-4451. They live at 143 Snapdragon Drive, Reno, NV 82102. For...
-
Yolanda is a cash basis taxpayer with the following transactions during the year: Cash received from sales of products........................................................................$65,000...
-
For each of the following cases, indicate the filing status for the taxpayer(s) for 2012 using the following legend: A - Single B - Married, filing a joint return C - Married, filing separate returns...
-
True or False: Inflation decreases the purchasing power of money.
-
Logan is conducting an economic evaluation under inflation using the then-current approach. If the inflation rate is \(j\) and the real time value of money rate is \(d\), which of the following is...
-
What is a good working definition of inflation in 10 words or less?
Study smarter with the SolutionInn App