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
Which of the following represents a transition?
timama [110]

Explanation:

C.

D.

395 - 44th Street Long B.

Ο Α

O

B

С

OD

8 0
3 years ago
My internet works but my router won't let any devices connect to it unless you use a cat. 5 cable :\
katovenus [111]
You would need to get a CAT5 cable, these usually dont cost much, as the manufacturing of these cables is cheaper and more common.

If you mean wireless connectivity, this could be due to your router not supporting wireless, meaning you would have to get a Wireless Access Point
5 0
3 years ago
How are cars made in georgia
Talja [164]

Answer:

Its same everywhere.

7 0
4 years ago
Binary is used to store what on a computer?<br> •Data<br> •Dates<br> •Address
solmaris [256]

Answer:

Data................

5 0
3 years ago
Read 2 more answers
I’ll mark brainlest
faust18 [17]

<u>Home </u><u>and</u><u> Insert</u>

In Microsoft office, to create a text box you will go to insert and then there will be various options there and you will see text box marking. so you will just have to click on text box and you can create it however you want to do it.

It's such a easy step(◕ᴗ◕✿)

3 0
3 years ago
Read 2 more answers
Other questions:
  • Aubrey didnt like to use graphics or images on her slides. She preferred to use only a title for her slides and bullet-poinged t
    14·2 answers
  • Read the excerpt below and answer the question.
    14·1 answer
  • How do I convert a number into a percentage in excel
    7·1 answer
  • Using _________ feature of macOS, you can have separate sets of open program windows for the desktop. It is a handy way to organ
    13·1 answer
  • By using the internet, your company can obtain discounts thorugh...
    15·2 answers
  • Hey hope you are having a great day. Please subscribe to me on You tube at (Resurgentz). :)
    13·1 answer
  • What are the two types of formulas in excel
    9·1 answer
  • Why are renewable natural resources important? A.fossil fuels can be replaced quickly.
    10·1 answer
  • You can access word's typographic characters with the _______ button on the insert tab
    9·1 answer
  • When using a small mic that attaches to your interview subject, where should you place that mic and why?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!