1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ymorist [56]
3 years ago
9

In this exercise, use the following variables : i,lo, hi, and result. Assume that lo and hi each are associated with an int and

that result refers to 0.
Write a while loop that adds the integers from lo up through hi (inclusive), and associates the sum with result.

Your code should not change the values associated with lo and hi. Also, just use these variables : i,lo, hi, and result.
Computers and Technology
1 answer:
Assoli18 [71]3 years ago
7 0

Answer:

result = 0

i = lo

while i <= hi:

       result = result + i

       i += 1

Explanation:

Initialize the <em>result</em> as 0 to hold the summation value.

Since we are asked not to change the value of <em>lo</em> and <em>hi</em>, our loop control variable is <em>i</em> and initially it starts from <em>lo.</em>

Since we are asked to add the number from <em>lo</em> to <em>hi, </em>while loop condition checks it.

While the condition satisfies (during each iteration), the value of <em>i</em> is added to the result and the value of <em>i</em> is incremented by one.

You might be interested in
Items that represent features of smartphones apps
Anestetic [448]
I believe they are icons.
8 0
3 years ago
On five lane roadways, the center lane is designated for __________ and is used by vehicles traveling in both directions.
Alla [95]
Answer : The center lane is designated for left turns

Explanation: 
This lane is used so that drivers would pull into in order to turn left when a clear merge is available. Its main purpose is not to cause traffic jam while waiting for the chance to turn left. It is illegal to use this lane for any other purposes
5 0
4 years ago
Grid computing is a type of computing in which:
fredd [130]

Answer:

b

Explanation:

A computing grid can be thought of as a distributed system with non-interactive workloads that involve many files.

7 0
3 years ago
The variables xp and yp have both been declared as pointers to integers, and have been assigned values. Write the code to exchan
shepuryov [24]
The question is asking us to swap the values of xp and yp while not changing where they point to. Setting xp equal to yp would not work because then we couldn't change yp since the value for xp was overwritten. We can use a third variable to swap them.

int zp = xp;
xp = yp;
yp= zp;
6 0
3 years ago
Create a cell reference in a formula by typing in the cell name or
il63 [147K]

Answer:

D. Clicking the cell

Explanation:

Clicking the target cell is an alternative way of typing in the cell name when creating a cell reference in a formula.

Hope this helps!

8 0
3 years ago
Read 2 more answers
Other questions:
  • Computer-generated color images of the brain that provide information about brain activity and glucose metabolism are produced b
    8·1 answer
  • Var cookie = "username=mike2009";
    10·1 answer
  • The item in this illustration that is highlighted is _____.
    11·2 answers
  • 2.27 LAB: Driving costs Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as
    14·2 answers
  • The IntList class contains code for an integer list class. Study it; notice that the only things you can do are: create a list o
    7·1 answer
  • Identify the data set level of measurement for the following: individual tax filing status (single, head of household, widowed,
    8·1 answer
  • Stay safe and search answers up if you need ​
    14·1 answer
  • What is a web client ​
    6·2 answers
  • Please choose the correct answer please tell fast​
    15·1 answer
  • Jaboooo helloooo are u there
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!