1) Use for loops to compute the following expression: 1 1 1 + + ...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1) Use for loops to compute the following expression: 1 1 1 + √₂ + √² + √³ + √5 + √² + Here a sample run: Part 01: 24.00 Round the sum to two decimal places using formatted string. 2) Use while loops to perform the following steps: a. Prompt the user to input two integers: firstNum and secondNum. If the secondNum is smaller than firstNum, swap the numbers. b. Output all odd numbers between firstNum and secondNum. c. Output the sum of the square of the odd numbers between firstNum and secondNum. d. Output the odd numbers between firstNum and secondNum, and their squares. Submit one single file. Save the file as a text file (.txt) Part 02: Enter first number Enter second number 7 Odd integers between 3 and 7 are: 357 5 25 7 49 + Sum of the squares of odd integers between 3 and 7 = 83 Odd integers and their square between 3 and 7 are: 39 624 + √625 1) Use for loops to compute the following expression: 1 1 1 + √₂ + √² + √³ + √5 + √² + Here a sample run: Part 01: 24.00 Round the sum to two decimal places using formatted string. 2) Use while loops to perform the following steps: a. Prompt the user to input two integers: firstNum and secondNum. If the secondNum is smaller than firstNum, swap the numbers. b. Output all odd numbers between firstNum and secondNum. c. Output the sum of the square of the odd numbers between firstNum and secondNum. d. Output the odd numbers between firstNum and secondNum, and their squares. Submit one single file. Save the file as a text file (.txt) Part 02: Enter first number Enter second number 7 Odd integers between 3 and 7 are: 357 5 25 7 49 + Sum of the squares of odd integers between 3 and 7 = 83 Odd integers and their square between 3 and 7 are: 39 624 + √625
Expert Answer:
Answer rating: 100% (QA)
Heres the Python code for both parts of your question mainpy Part 01 Initialize the sum sumexpressio... 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
-
Jackson Ltd ( Jackson ) acquired 1 0 0 % of the ordinary share capital of James Ltd ( James ) for shs 1 0 , 0 0 0 , 0 0 0 on 1 st January 2 0 1 1 . This figure included shs 9 6 0 , 0 0 0 for...
-
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...
-
Declare and assign these variables as shown (all your code must appear in the body of the main method): String firstName = "Blueberry"; String lastName = "Strawberry"; In addition, declare and...
-
Correction, overproduction, inventory and motion are all examples of: a. Waste b. 5 S target areas c. Noise d. Value-added activities
-
Each of the frames shown consists of two L-shaped members connected by two rigid links. For each frame, determine the reactions at the supports and indicate whether the frame is rigid. -2a -2n 2a la)...
-
Rewrite Programming Exercise 7.5 using streams. Display the numbers in increasing order. Data from Programming Exercise 7.5 Write a program that reads in 10 numbers and displays the number of...
-
Review the information on YouTube in this section of the chapter and conduct your own research. What evidence is there that beginning with the end in mind was part of YouTubes founders original plan?
-
The Hit-and-Miss Manufacturing Company produces items that have a probability p of being defective. These items are produced in lots of 150. Past experience indicates that p for an entire lot is...
-
(4%) Problem 15: A patient is receiving saline solution from an intravenous (IV) system. The solution passes through a needle of length 2.2 cm and radius 0.16 mm. There is an 8.00 mm-Hg gauge...
-
Find the volume of the solid obtained by rotating the region under the graph of the function f(x) = 6. 2 about the x-axis over the interval [1,3]. x+1 Sketch the region and find the volume of the...
-
An object is placed between the focal point of a converging lens and the lens. The resulting image of the object will be a. real and erect. b. real and inverted. c. virtual and erect. d. virtual and...
-
Given faxiy]=-x-4x95 +5y, find fxCx= fy Cx, D=
-
Find the solution to 38% 3x-5 Provide your answer below: x= Content attribution Search or type URL # 3 4 % 5 6 7 E R T Y
-
Calculate how many hours on a minimum wage ($10.10) job a single parent with two children would need to work in a month to achieve a living wage ($44.63).
-
Find inverse y = - 4 / 5 x + 1 1
-
The solution of ly - 15| <23 is
-
Politicians often talk about introducing 'investment tax credits'. If there is investment tax credit, the government refunds a fraction of the investment purchase (or, firms pays discounted price to...
-
In Exercises evaluate the limit, using LHpitals Rule if necessary. lim 07x cos x X
-
Ann hires a nanny to watch her two children while she works at a local hospital. She pays the 19-year-old nanny $125 per week for 48 weeks during the current year. a. What is the employer's portion...
-
Matthew borrows $250,000 to invest in bonds. During 2012, his interest on the loan is $30,000. Matthew's interest income from the bonds is $10,000. This is Matthew's only investment income. a....
-
In 2012, Margaret and John Murphy are married taxpayers who file a joint tax return with AGl of $25,000. During the year they incurred the following expenses: Hospitalization insurance...
-
Make a bar chart of \(\mathrm{CO}_{2}\) footprint divided by embodied energy, using data from the data sheets of Appendix A, Table A10, for a. Cement b. Low carbon steel c. Copper d....
-
a. Window frames are made from extruded aluminium. It is argued that making them instead from extruded PVC would give a product with a lower embodied energy and carbon footprint. If the section shape...
-
a. A range of office furniture includes a chunky hardwood table weighing \(18 \mathrm{~kg}\) and a much lighter table with a \(3.0 \mathrm{~kg}\) virgin aluminium frame and a \(3.0 \mathrm{~kg}\)...
Study smarter with the SolutionInn App