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]
2 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]2 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
How do you change the desktop background in the macos mojave operating system?
sleet_krkn [62]

Answer: Click the System Preferences icon on the dock. In the first row, click Desktop & Screen Saver.

Explanation: When it comes to macOS versions, Mojave and High Sierra are very comparable. The two have a lot in common, unlike Mojave and the more recent Catalina.

8 0
1 year ago
A web designer must effectively communicate when he/she designs a web page. If there is too much information to put onto one pag
valina [46]
Usually they'll add a link to the bottom of the page to the next page.

7 0
2 years ago
Write one for loop to print out each element of the list several things. then write another for loop
Kay [80]

Question:

Write one for loop to print out each element of the list several_things. Then, write another for loop to print out the TYPE of each element of the list several_things.

Answer:

The solution in python is as follows:

for element in several_things:

    print(element)

   

for element in several_things:

    print(type(element))

Explanation:

The solution assumes that the list several_things has already been initialized.

So, the rest of the code is explained as follows:

This line iterates through the list, several_things

for element in several_things:

This line prints each element

    print(element)

This line iterates through the list, several_things for the second time    

for element in several_things:

This line prints the type of each element

    print(type(element))

6 0
2 years ago
Which of the following is NOT considered an interactive?
joja [24]

Answer: Calendar

Explanation:

Feedback forms, text and social media integration are considered to be interactive. A feedback form is used by an individual or a organization to get a feedback on a certain topic.

A text and social media integration are also interactive as well as the sender and receiver can have an interactive session through both means.

Therefore, the correct option is a calendar as this is not Interactive.

5 0
2 years ago
Mary is proofreading an eBook. Sometimes she has to scroll several pages at a time. Which key on the numeric keypad will help he
Leto [7]
The number key 2 will help her scroll down.
3 0
3 years ago
Read 2 more answers
Other questions:
  • Answer this question please
    6·1 answer
  • How did The Gates by Christo and Jeanne-Claude affect the site?
    11·2 answers
  • Please I need help with this !!!! <br> Complete the table given below.
    8·1 answer
  • How can volunteering yo help plan fundraiser for your team or club be a way to develop your strengths?
    13·1 answer
  • Given the following output from /etc/fstab, which filesystems will be automatically checked on boot by the fsck command? [BEGIN
    5·1 answer
  • PLEASE HELP ASAP!!! 99 POINTS FOR 3 MULTIPLE CHOICE QUESTIONS!!! PLEASE ANSWER ALL!!!
    8·1 answer
  • Nathaniel wanted to buy a microphone. He went to an electronics store and was told that there are actually two types of micropho
    13·2 answers
  • if you were determining what was expected of you simply by looking at media, what messages would you take away?
    8·2 answers
  • Hi I got a new phone and my photos are taking so long to download, on Friday it was at 13000 what do I do it’s taking so long
    14·1 answer
  • Which is a type of artificial neural network (ann) that includes many layers to deal with complex problems that may have very la
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!