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
AfilCa [17]
3 years ago
8

A programmer wrote the code segment below to display the average of all the elements in a list called numbers. There is always a

t least one number in the list. text... The programmer wants to reduce the number of operations that are performed when the program is run. Which change will result in a correct program with a reduced number of operations performed?
Computers and Technology
1 answer:
mestny [16]3 years ago
3 0

Answer:

Swap codes in line 7 and 8

Explanation:

The code segment below

Line 1: count ← 0

Line 2: sum ← 0

Line 3: FOR EACH value IN numbers

Line 4: {

Line 5: count ← count + 1

Line 6: sum ← sum + value

Line 7: average ← sum / count

Line 8: }

Line 9: DISPLAY (average)

The above code will make the program translator calculate the average value at each iteration.

This will take a longer time to execute and also means more instructions for the program translator.

Swapping line 7 and 8 will reduce the number of instructions to execute. This will have an instant effect on the time taken to execute the program.

Swapping line 7 and 8 means that, the program translator will only calculate the average after it must have finished calculating the sum of the values in the iteration statement.

You might be interested in
An administrator has been asked to update a flow that was created as part of a recent update. When the administrator opens the f
Luba_88 [7]

There are steps to take so as to update a flow that was created as part in recent update. What would cause the said action is that  the flow Is a before save flow.

<h3>What is a flow</h3><h3 />
  • A flow in this scenario is known to makes before-save updates and it is known to be quite similar to a before trigger.

The Before-save Flow is known to be a trigger that is done before a given operation.

See full question below

An administrator has been asked to update a flow that was created as part of a recent update. When the administrator opens the flow for edtting, the Flow Bunder toolbox offers only four elements: Assignment, Decision, Get Records, and Loop.

What would cause this?

A . The flow Is a before save flow.

B . The flow Is a screen flow.

C . The version of the flow is activate.

D . The version of the flow is inactive.

Learn more about Flow from

brainly.com/question/6532130

4 0
2 years ago
Can find error , suppose to print what season it is and if fails : Traceback (most recent call last):
Rudik [331]

Answer:

Change:

print("Season is",season)

To:

print("Season is " + season)

Explanation:

String Concatenation can be done using many ways but not by comma. You can use the + operator like i just did or % operator, join method or format function.

But for now, try using the + operator.

7 0
2 years ago
In microsoft word, when you highlight existing text you want to replace, you’re in
Sergio039 [100]
 Hello <span>Christinamauffp2olwu</span><span>

Answer: In Microsoft Word, when you highlight existing text you want to replace, you're in insert mode.

Hope This Helps :-)
-Chris</span>
6 0
3 years ago
what will happen to the contents of the destination ell if you copy the contents of the source cell into the destination cell
DochEvi [55]

Answer:

It's content will be replaced with a content from the source cell.

7 0
3 years ago
bro i got banned for posting an amazing bulk pic, but this dude literally posted an inappropriate, dafuq is wrong with this bann
Ludmilka [50]

Answer:

okkk

Explanation:

5 0
2 years ago
Read 2 more answers
Other questions:
  • 30
    5·1 answer
  • Type an SQL statement into the Record Source property of the report. The statement should select all fields (*) for employees wi
    5·1 answer
  • Tweaking existing technology in a new way is usually called _____. leveraged creativity state-of-the-art breakthrough applicatio
    5·1 answer
  • Where does the list of incoming mail appear in gmail
    13·2 answers
  • The 'WIMP' environment is much more user friendly,why?​
    11·2 answers
  • Which memory can be removed from motherboard? RAM OR ROM?​
    11·1 answer
  • If i keep giving out brainlyest will i get banned again?
    12·2 answers
  • What is the purpose of application software policies? Check all that apply.
    9·1 answer
  • Refund please, this has not helped at all.
    6·2 answers
  • the ghost adventures team uses a variety of tools and technology in investigations. which one is described as an adjustable freq
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!