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
In a Web-based database, middleware is used to transfer information from the organization's internal database back to the Web se
Viefleur [7K]

Answer: True

Explanation:

 Yes, the given statement is true that the web based database used the various types of database applications for transferring the information or data.

  • The web database applications are basically designed so that the users managed and easily access the information by using the internet.
  • It is works as the middleware form for transferring the data from the internal database of an organization to the web server and it is known as web page for the user interface.
  • We can store various types of business and also personal related data by using the web database.

4 0
3 years ago
View the attached picture
amm1812

A. B)

B. B) 1837 Douglass joins the East Baltimore Improvement Society

C. A) offers effects when moving from one slide to the next.

Hope this helps!!


8 0
3 years ago
Which statement is true regarding Artificial Intelligence (AI)?
Effectus [21]
Data is the fundamental reason AI succeeds or fails.
This statement is true regarding Artificial Intelligence (AI)
6 0
2 years ago
_________________: informal messages that are passed on from person to person
sasho [114]

Answer:

Grapevine is the answer

4 0
2 years ago
The ______ cloud service model provides virtual environments online that can be tailored to the needs of developers
Ratling [72]
Internet cloud service that could be accessed by other devices with a certain password
3 0
2 years ago
Other questions:
  • What precaution can you take while using a social networking site to prevent a data breach?
    15·1 answer
  • WILL UPVOTE ALL.
    7·1 answer
  • Fair use allows individuals to break copyright so long as they ________.
    15·1 answer
  • The acronym LAH stands for
    14·2 answers
  • Dylan, an interior designer, has sketched out a layout for a client's living room. He wants the client's approval of the layout
    11·2 answers
  • You are the CISO of a company and you need to create logging policies. Please review NIST SP800-92, specifically sections 4–3 th
    12·1 answer
  • I love dog my is 16 weeks old how old is yours
    12·1 answer
  • Describe Relational Query Languages and Operations.
    15·1 answer
  • Complete the function favoriteFlower(). Note that the program will not run as is because the function is incomplete. The purpose
    15·1 answer
  • Write a python program that will read a number (num) and display all the numbers divisible by 3 or 5
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!