!]: M # 2]: a. Write a program using for loop to print all odd numbers...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
!]: M # 2]: a. Write a program using for loop to print all odd numbers between 0 and 16. (2 points) 3]: b. Write a program using for loop to print all even numbers between 20 and 0 inclusively (largest to smallest). (3 points) #Your Code Here c. Write a program in which you ask user to enter positive numbers in a loop. Loop should end when user enters a negative number. When loop ends print (i) average of all valid positive numbers entered by user, (ii) smallest valid number entered by user and (iii) largest valid number entered by user. Please do not use any language constructs (like Arrays etc) that we have not studied so far. (5 points) #Your Code Here d. Write a program where you ask user to enter a positive integer and then you print table like shown below. (5 points) Suppose user entered 12 then your program should print following table 1 x 12 = 12 2 x 12 = 24 3 x 12 = 36 4 x 12 = 48 5 x 12 60 6 x 12 = 72 7 x 12 = 84 8 x 12 = 96 9 x 12 = 108 10 x 12 = 120 =]: #Your Code Here !]: M # 2]: a. Write a program using for loop to print all odd numbers between 0 and 16. (2 points) 3]: b. Write a program using for loop to print all even numbers between 20 and 0 inclusively (largest to smallest). (3 points) #Your Code Here c. Write a program in which you ask user to enter positive numbers in a loop. Loop should end when user enters a negative number. When loop ends print (i) average of all valid positive numbers entered by user, (ii) smallest valid number entered by user and (iii) largest valid number entered by user. Please do not use any language constructs (like Arrays etc) that we have not studied so far. (5 points) #Your Code Here d. Write a program where you ask user to enter a positive integer and then you print table like shown below. (5 points) Suppose user entered 12 then your program should print following table 1 x 12 = 12 2 x 12 = 24 3 x 12 = 36 4 x 12 = 48 5 x 12 60 6 x 12 = 72 7 x 12 = 84 8 x 12 = 96 9 x 12 = 108 10 x 12 = 120 =]: #Your Code Here
Expert Answer:
Answer rating: 100% (QA)
aHeres the program using a for loop to print all odd numbers between 0 and 16 in Python The ra... View the full 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
-
Assume that Z1, Z2....., Z, is a random sample from a standard normal population, that n is an integer less than n and greater than 0, and that n = nn. Identify the distributions of (a) Y=ZY-Z and Y...
-
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...
-
Design a fuzzy control system of Health Monitoring Systems.
-
A random variable follows the continuous uniform distribution between 60 and 95. a. Calculate the following probabilities for the distribution: 1. P(x > 63) 2. P(x > 70) 3. P(x > 88) 4. P(x = 75) b....
-
The density of water for 0C < T < 100C is given in Table A-1. Fit this data to a least-squares parabola, = a + bT + cT2, and test its accuracy vis-a-vis Table A-1.Finally, compute at T = 45C and...
-
The bookkeeper for Roger's Dance Studio made the following errors in journal- izing and posting. 1. A credit to Supplies of $600 was omitted. 2. A debit posting of $300 to Accounts Payable was...
-
The input power, \(\dot{W}\), to a large industrial fan depends on the fan impeller diameter \(D\), fluid viscosity \(\mu\), fluid density \(ho\), volumetric flow \(Q\), and blade rotational speed...
-
A consulting firm specializing in agriculture determines that the following combinations of hay and grain consumption per lamb will result in a 25- pound gain for a lamb: a. The firm's president...
-
Zoe Corporation has the following information for the month of March: Cost of direct materials used in production $18,132 Direct labor 24,624 Factory overhead 35,790 Work in process inventory, March...
-
The CEO of Kuehner Development Co. has just come from a meeting with his marketing staff where he was given the latest market study of a proposed new shopping center, Parker Road Plaza. The study...
-
You are the owner of a used car dealership and have just purchased 100 small cars. Your advertising agency is preparing your next promotional campaign. Because you purchased the cars, the agency has...
-
Big Company wants to acquire 25% of Little Company. Little Company has balance sheet assets of $500,000 and liabilities of $300,000 for a net book value of $200,000. Big Company determines that...
-
Arndt, Incorporated reported the following for 2024 and 2025 ($ in millions): Revenues 2024 $ 888 2025 Expenses 760 $ 980 800 Pretax accounting income (income statement) Taxable income (tax return) $...
-
If you wanted to develop a telescope, what kind of lenses would you use for the objective lens (the lens that collects the light) and the eyepiece? Explain your reasoning. Draw a picture with ray...
-
An employee, paid $2,000 biweekly, has a marital status of Married, claiming 2 allowances on Line 5 of a 2019 Form W-4. $50 is entered in the box on Line 6. Using the Percentage Method for Manual...
-
Consider a user who needs to transmit 1 . 5 gigabytes of data to a server. The user lives in a small town where only dial - up access is available. A bus visits the small town once a day from the...
-
Dallas and Weiss formed a partnership to manage rental properties, by investing $160,000 and $240,000, respectively. During its first year, the partnership recorded profit of $506,000 Required:...
-
The diagram shows the two forces acting on a small object. Which of the following is the resultant force on the object? A. 8 N downwards B. 8 N upwards C. 2 N downwards D. 2 N upwards 3 N 5 N
-
Tom has a successful business with $100,000 of income in 2012. He purchases one new asset in 2012, a new machine which is 7-year MACRS property and costs $25,000. If you are Tom's tax advisor, how...
-
Deborah purchases a new $30,000 car in 2012 to use exclusively in her business. If Deborah does not elect to expense or take bonus depreciation in 2012 and holds the car until it is fully...
-
During 2012, Palo Fiero purchases the following property for use in his manufacturing business: Palo uses the accelerated depreciation method under MACRS, if available, and does not make the election...
-
Basic Chemicals Ltd produces a highly flammable chemical product. The company experienced a flood on 1 April 2025 that destroyed its entire work in process inventory but did not affect the raw...
-
Cold Appliances Pty Ltd makes refrigerators and is trying to determine the cost of its ending work in process. The accountant has put together the following data for the year ended 30 June 2025. Each...
-
An apparatus for measuring thermal conductivity employs an electrical heater sandwiched between two identical samples of diameter \(25 \mathrm{~mm}\) and length \(60 \mathrm{~mm}\), which are pressed...
Study smarter with the SolutionInn App