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
What are examples of macro events related to a form? Check all that apply.
Westkost [7]

Answer:

A form is closed

A form is resized.

A form is opened

A user presses a key

A user moves the mouse

Explanation:

There are different events in a form, and we can use them in different situations like:

  • We can use On Resize to resize our form.
  • If we On Load the form will be displayed.
  • On Clicked, If there was a click in an object
  • On Unload to close the form.
  • On Mouse Enter and On Mouse Leave, in this case, the mouse enters or leaves the object.

6 0
4 years ago
Filmmakers must often establish information quickly in a film in order to give the audience context for the plot. In this film,
Dimas [21]
One thing evident about the two individuals is that Don and Lina are famous. The filmmaker, in the beginning uses the announcer to introduce them as "known all over the world." Another thing to note is that Don and Lina personified themselves a certain way to their fans. The announcer believed sincerely that they were courting. While the announcer played a huge part in giving the audience information that Don and Lina were courting, the filmmaker made sure that audience (crowd in the scene) played a vital part too. Once Don and Lina posed for a picture together, the crowd went wild. This implies that the audience believed that they were together.
8 0
3 years ago
Variablesallow us to manipulate data through the ___________.
gladu [14]

Answer:

Reference

Explanation:

Variables provide reference to the stored data value.

For example:

int i = 0;

Here i is a variable of type int with an initial value of 0. i is a reference to this stored value 0. Now if I want to update the data, I can do so using this reference.

i = 1;

Now the reference is used to manipulate the stored data and change it to 1. In a similar manner all updates to the value can be done using the variable reference.

8 0
3 years ago
Which of the following general classes of computers designed for medical, engineering, or animation and graphics design uses are
jasenka [17]

Servers is the general classes of computers designed for medical, engineering, or animation and graphics design uses are optimized for visualization and rendering of three-dimensional models, and typically have fast processors, large memory, and advanced video cards.

D) servers

<u>Explanation:</u>

Better to use servers, where it can handle multiple tasks since it has enough multiple microprocessors.

Normal PC memory is little slow then server memory.  In case slow processing the graphics or animation end user can include memory cards in servers.  Good advanced video graphics card be insert to the server slot for better performance. Good advance video graphics has also extra memory to process the graphics animation.

Normally personal computers also be achieved but it has own limitation.  Simple animation can be achieved by personal computers.

7 0
4 years ago
Use a colon before a list and put one space after a colon. TRUE OR FALSE
Novosadov [1.4K]

Its TRUE . you use a colon before a series or list only if the words make up a complete sentence.

4 0
4 years ago
Read 2 more answers
Other questions:
  • In what country have regulators demanded that facebook stop collecting biometric data on its users?
    10·1 answer
  • What does atx stand for?
    10·2 answers
  • QUESTION 7 of 10: A surplus can be best defined as:
    10·1 answer
  • To define constructors and member functions outside of a class's original scope, the operator can be used.
    11·1 answer
  • If you see an icon in a document preset that looks like a tiny web browser window, what type of document is the preset meant to
    13·1 answer
  • 1) These are operators that add and subtract one from their operands.
    7·1 answer
  • The best way to insert an existing Excel chart into a document is to
    8·1 answer
  • Under which menu option of a word processing program does a callout appear?
    7·2 answers
  • What are the ways to search out a number from a tree?
    11·1 answer
  • 4.8.4 Better Sum
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!