Problem 1 Consider the following flowchart/algorithm. a) If the value of n is 5 then what...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem 1 Consider the following flowchart/algorithm. a) If the value of n is 5 then what would be the output of the algorithm? b) What does the algorithm do? a. It outputs the sum of the first n even numbers b. It outputs the sum of the first n odd numbers 5+5+35+ 5 = 50 points c. It outputs the sum of the first n integers d. It outputs the average of the first n numbers c) Implement the algorithm using Python programming language. In your Python code rename the variable var_XX. Replace the XX using the last two digits of your student number. If the student number is 12345 then the variable name would be var_45. Use your actual student number. d) If n = 10 what would be the output of the algorithm? Start GET n i-0 var_XX-0 Loop NO var_XX-var_XX +i i+i+1 PUT Var XX End Problem 1 Consider the following flowchart/algorithm. a) If the value of n is 5 then what would be the output of the algorithm? b) What does the algorithm do? a. It outputs the sum of the first n even numbers b. It outputs the sum of the first n odd numbers 5+5+35+ 5 = 50 points c. It outputs the sum of the first n integers d. It outputs the average of the first n numbers c) Implement the algorithm using Python programming language. In your Python code rename the variable var_XX. Replace the XX using the last two digits of your student number. If the student number is 12345 then the variable name would be var_45. Use your actual student number. d) If n = 10 what would be the output of the algorithm? Start GET n i-0 var_XX-0 Loop NO var_XX-var_XX +i i+i+1 PUT Var XX End
Expert Answer:
Answer rating: 100% (QA)
a The output of the algorithm when n 5 would be 15 b The ... View the full answer
Related Book For
Corporate Finance A Focused Approach
ISBN: 978-1439078082
4th Edition
Authors: Michael C. Ehrhardt, Eugene F. Brigham
Posted Date:
Students also viewed these programming questions
-
Assignment 5: Hash Table implementation andconcordance There are three parts to this assignment. In the first two parts,you will complete the implementation of a hash map and aconcordance program. In...
-
For each problem, show your work steps. A correct answer with no work shown gets half credit (which means you fail the assignment). An incorrect answer with no work receives 0 credit. With time value...
-
Write the Comparison for Legal Factors of China and South Africa
-
Find the z-score such that the area under the standard normal curve to its left is 0.2. Find the indicated z-score. Be sure to draw a standard normal curve that depicts the solution.
-
Write the system of equations corresponding to each augmented matrix. Then perform the indicated row operation(s) on the given augmented matrix. R = -r2 + r r2 + r3 4 -3 -1 3 -5 4 6. R3 = -3 -6 6.
-
Extreme Machine manufactures machines and parts for various industries; they have an office in Youngstown, Ohio. Avery Dennison manufactures and sells labels from a plant in Mentor, Ohio. They use...
-
Capitalization of Interest McPherson Furniture Company started construction of a combination office and warehouse building for its own use at an estimated cost of $5,000,000 on January 1, 2010....
-
You will be taking over the vending machine business at UNCC from Tony. You are selling 20-ounce bottles of Dasani bottled water for $1.25, and Tony will give you a large stock of Dasani to get you...
-
What is the output of C Program? #include void fun(int ary[3][3]) { } { int i = 10, j = 12, k; ary [0] [0]= i; ary [1][1] = j; ary [2][2] = 2; for (k 0; k
-
How does the direction of intra-entity transfers (resulting in intra-entity gross profit in inventories) affect the computation of the noncontrolling interest's share of consolidated net income Both...
-
Infinity Bank has the following balance sheet. Assets Amount Liabilities and Equity Amount ($million) Treasury notes 20 Deposits ($million) 150 Local government bonds 30 Floating-rate notes 25...
-
A child is spinning a rock at the end of a 2-foot rope at the rate of 180 revolutions per minute (rpm ). Find the linear speed of the rock when it is released.
-
As the Compliance Officer (CO) for Centennial Health (CH), you've just identified a "Cup Agreement" launched offering physicians free urine cups for those practices that signed up. With this...
-
Scenario: Henri and Lila are about to close on their new home. You are a sales agent for the clients and have been asked by them to review the closing documents for accuracy. You find three errors on...
-
A, B, C are aiming to shoot a baloon. A will succeed 4 times out of 5 attempts. The chance of B to shoot the baloon is 3 out of 4 and that of C is 2 out of 3. If the three aim the baloon...
-
Write the given system without the use of matrices. D) - ()- d (x sin t + 8 (2+ 1)
-
Use the following income statements and balance sheets to calculate Garnet Inc.'s free cash flow for 2011. GarnetInc. Income State ment 2011 2010 $500,0 Net sales $530.0 Costs (except depreciation)...
-
Upton Computers makes bulk purchases of small computers, stocks them in conveniently located warehouses, ships them to its chain of retail stores, and has a staff to advise customers and help them...
-
The Brownstone Corporations bonds have 5 years remaining to maturity. Interest is paid annually, the bonds have a $1,000 par value, and the coupon interest rate is 9%. a. What is the yield to...
-
The following are some costs incurred by a shoe manufacturer. Decide whether each one is a fixed cost or a variable cost or has some element of both. (a) The cost of leather; (b) The fee paid to an...
-
Why does the marginal cost curve pass through the bottom of the average cost curve and the average variable cost curve?
-
Outline the main factors that might influence the size of the profit mark-up set by a business.
Study smarter with the SolutionInn App