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 is file management?can please help me​
ruslelena [56]
Is the process of administering a system that correctly handles digital data. also i think it improves the overall function of a business workflow. but this could be totally wrong.
6 0
3 years ago
Read 2 more answers
What are price comparison websites?
Wittaler [7]

Answer:

A comparison shopping website, sometimes called a price comparison website, price analysis tool, comparison shopping agent, shopbot, aggregator or comparison shopping engine, is a vertical search engine that shoppers use to filter and compare products based on price, features, reviews and other criteria.

<h3><u>PLEASE</u><u> MARK</u><u> ME</u><u> BRAINLIEST</u><u>.</u></h3>
8 0
3 years ago
What is the final gear reduction of a compound gear reduction of 36 to 12 for the first stage and 60 to 12 for the second stage?
OverLord2011 [107]

Answer:

8

Explanation:

Gear reduction = driven gear teeth / driving gear teeth

First stage reduction :

Driven gear teeth = 36

Driving gear teeth = 12

36 /12 = 3

Second stage reduction :

Driven gear teeth = 60

Driving gear teeth = 12

60 /12 = 5

First stage + second stage

3 + 5 = 8

5 0
3 years ago
1: define about information system in computer?
kobusy [5.1K]

Explanation:

1. Information system is a collection of people, procedures, software, hardware, and data to provide essential information to run an organization.

2. Thesaurus is a software tool used in Microsoft Word document to provide synonyms and antonyms for a selected word.

3. Computer component refers to a basic physical element that is required by the computer to function.

5 0
3 years ago
What are the three major functions of a game engine?
Harrizon [31]
read that hope this helped

8 0
3 years ago
Other questions:
  • A circuit has a resistance of 300 ohm and a current of 0.024 A. What is the voltage in the circuit?
    12·1 answer
  • Can you subnet the 172.16.128.0/17 network address to support this subnet?
    6·1 answer
  • What is a nonlinear presentation
    9·2 answers
  • Create a new conditional format that applies yellow fill (fourth color under Standard Colors) and bold font to values that conta
    14·1 answer
  • Write the steps for displaying multiple subtotal functions in excel.
    10·1 answer
  • Write a for loop to verify that your function is correctly returning the expected output for the radius values between 0 and 11.
    14·1 answer
  • The process known as "bitmapping" is defined as information in _____. PLEASE HELP FAST
    11·1 answer
  • Who is the father of computer?​
    14·1 answer
  • Leah wants to add an image to her updated presentation, so she wants to access the Help interface. What should Leah do to access
    11·2 answers
  • What is the Cycle of Dependency?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!