Write a loop that computes a. The sum of all even numbers between 2 and 100 (inclusive).
Question:
Write a loop that computes
a. The sum of all even numbers between 2 and 100 (inclusive).
b. The sum of all squares between 1 and 100 (inclusive).
c. The sum of all odd numbers between a and b (inclusive).
d. The sum of all odd digits of n. (For example, if n is 32677, the sum would be 3 + 7 + 7 = 17.)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 77% (9 reviews)
Part a sum0 for i in range21012 sumi Part b ...View the full answer
Answered By
Marvine Ekina
Marvine Ekina
Dedicated and experienced Academic Tutor with a proven track record for helping students to improve their academic performance. Adept at evaluating students and creating learning plans based on their strengths and weaknesses. Bringing forth a devotion to education and helping others to achieve their academic and life goals.
PERSONAL INFORMATION
Address: , ,
Nationality:
Driving License:
Hobbies: reading
SKILLS
????? Problem Solving Skills
????? Predictive Modeling
????? Customer Service Skills
????? Creative Problem Solving Skills
????? Strong Analytical Skills
????? Project Management Skills
????? Multitasking Skills
????? Leadership Skills
????? Curriculum Development
????? Excellent Communication Skills
????? SAT Prep
????? Knowledge of Educational Philosophies
????? Informal and Formal Assessments
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Write programs with loops that compute a. The sum of all even numbers between 2 and 100 (inclusive). b. The sum of all squares between 1 and 100 (inclusive). c. All powers of 2 from 20 up to 220. d....
-
Write a program that finds the sum of all even numbers between 1 and 1000 in C++
-
Write a method that returns the sum of all the elements in a specified column in a matrix using the following header:public static double?sumColumn(double[][] m,?int?columnIndex)Write a test program...
-
A horizontal jet of water (at 10C) that is 6 cm in diameter and has a velocity of 20 m/s is deflected by the vane as shown. If the vane is moving at a rate of 7 m/s in the x-direction, what...
-
Suppose that yearly health care expenses for a family of four are normally distributed with a mean expense equal to $3,000 and a standard deviation of $500. An insurance company has decided to oiler...
-
(a) How is resistance present in all transmission lines? (b) How is inductance present in all transmission lines? (c) How is capacitance present in all transmission lines? (d) The combined effects of...
-
The number of daily newspapers in the United States is now 1,387, and it was 2,226 in 1900. For each pair of values, use a percentage to express their relative change or difference. Use the second...
-
Projects that span more than one year or cut across the date of corporate salary increases may require the use of forward-pricing rates. Forward-pricing rates are determined from economic data,...
-
The Source-Message-Channel-Receiver model of communication grossly distorts the great differences among individuals in patterns of exposure and ways of processing the information they receive.
-
A load of lumber is lifted using a triple leg sling. Knowing that at the instant shown the lumber is at rest and that the tension in leg AD is 220 lb, determine the weight of the lumber. 65H
-
Prime numbers. Write a program that prompts the user for an integer and then prints out all prime numbers up to that integer. For example, when the user enters 20, the program should print 2 3 5 7 11...
-
Provide trace tables for these loops. a. int i = 0; int j = 10; int n = 0; while (i < j) { i++; j--; n++; } b. int i = 0; int j = 0; int n = 0; while (i < 10) { i++; n = n + i + j; j++; } c. int i =...
-
Jean inherited $25 000, whereby the terms of the inheritance state that she is to receive $1500 at the end of each quarter, starting in 3 years, until the money is completely withdrawn. If the money...
-
3) Consider the circuit 100 V 2 F 4 F 5 3 F What is the equivalent capacitance, in F, for this network? b
-
A body moves on the horizontal plane along axis x. Its initial position (at t = 0) is x = 0 and its initial velocity is vo. The only force acting on this body is friction F(v) = -Man |v- v. Here M is...
-
4. Write out the loop and junction equations that describe the circuit in Fig. 3. V001 R001 R003 R006 R002 ww V002 R004 R005 ww ww Fig. 3. Circuit diagram for problem 4. +
-
4) Consider the circuit EB 6.8 11 1.4 11 F X b 11 F 11 F 16.8 F What is the equivalent capacitance, in F, for this network?
-
Gail receives a distribution of $5,400 from her mutual fund holdings. Of this amount, $2,600 is considered capital gains while $2,800 is considered dividends from eligible Canadian corporations. If...
-
Lo-bed Company produces a product that requires two standard gallons per unit. The standard price is $20.00 per gallon. If 4,000 units required 8,200 gallons, which were purchased at $19.75 per...
-
In the current year, the City of Omaha donates land worth $500,000 to Ace Corporation to induce it to locate in Omaha and create an estimated 2,000 jobs for its citizens. a. How much income, if any,...
-
We want to transmit 1000 characters with each character encoded as 8 bits. a. Find the number of transmitted bits for synchronous transmission. b. Find the number of transmitted bits for asynchronous...
-
We need a three-stage space-division switch with N = 100. We use 10 crossbars at the first and third stages and 4 crossbars at the middle stage. a. Draw the configuration diagram. b. Calculate the...
-
Consider an n k crossbar switch with n inputs and k outputs. a. Can we say that the switch acts as a multiplexer if n > k? b. Can we say that the switch acts as a demultiplexer if n < k?
-
Given the weather conditions, we want to predict if a person is going to go for a run or not. The data that we have collected are the following: Sample Features Outcome: Go for Run? Forecast...
-
An asset manager wishes to reduce his exposure to large-cap stocks and increase his exposure to small-cap stocks. He seeks to do so using an equity swap. He agrees to pay a dealer the return on a...
-
The Jackson-Timberlake Wardrobe Company just paid a dividend of $1.44 per share on its stock. The dividends are expected to grow at a constant rate of 7 percent per year indefinitely. a. If investors...
Study smarter with the SolutionInn App