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
Which two climates have moderate rainfall and experience warm summers and cold winters due to their position relative to mountai
77julia77 [94]
Most probably grassland and steppes
6 0
2 years ago
what term defines inventiveness uncertainty and futuristic ideas typically deals with science and technology
Kruka [31]

Answer:

Innovation.

Explanation:

Innovation can be considered the ideal term, because an innovative idea arises from the set of a new technique, method or invention that aims to improve an existing method, standard, or product.

However, added to an innovative idea is the risk, since innovation breaks an already established standard, so it is through science and technology that an invention will gain greater foundation and recognition, which increases its credibility and acceptance.

3 0
3 years ago
Your boss in the human resources department asks you to write a function that calculates the length of time that employees have
Tems11 [23]

Answer:

Option D is correct i.e., =DATEDIF(C2, $AE$2, "y").

Explanation:

The user's supervisor well into the following department tells him to compose the feature which measures the amount that times staff has served in their company utilizing the DATEDIF feature. Consider whether C2 includes the hiring dates for that staff and then that cell $AE$2 includes the cut-off point for whom to evaluate the hiring time with the duration of the service.

So, therefore the following option is correct according to the given scenario.

4 0
3 years ago
In python 3.17 LAB: Convert to dollars
krok68 [10]

To convert the inputs to dollars and cents, we make use of a combination of multiplication and addition.

The program written in Python where comments are used to explain each line is as follows:

<em />

<em>#This gets input for the number of quarters</em>

quarters = int(input("Quarters: "))

<em>#This gets input for the number of dimes</em>

dimes = int(input("Dimes: "))

<em>#This gets input for the number of nickels</em>

nickels= int(input("Nickels: "))

<em>#This gets input for the number of pennies</em>

pennies= int(input("Pennies: "))

<em>#This converts the amount to dollars and cents</em>

dollars = quarters * 0.25 + dimes * 0.10 + nickels * 0.05 + pennies * 0.01

<em>#This prints the amount to 2 decimal places</em>

print("Amount ${:.2f}".format(dollars))

Read more about Python programs at:

brainly.com/question/22841107

7 0
2 years ago
All digital devices use software programs to function. Software <br> BLANK create these programs.
yarga [219]
Application I think because software used to create a program is called application software I'm not entirely sure about that though
7 0
3 years ago
Other questions:
  • ____ are the computers that store network software and shared or private user files.
    6·1 answer
  • The ____ category of apps makes the computer easier for blind people to use.
    9·1 answer
  • Which social media post indicates your home may be unattended?
    10·1 answer
  • How many bits would be in the memory of a computer with 4kb memory?
    8·1 answer
  • Discuss trends in cellular data transmission speeds
    15·2 answers
  • Which of the following does not use a Graphic User Interface?
    14·1 answer
  • What does Al stand for?
    10·1 answer
  • Write an application that determines whether the first two files are located in the same folder as the third one. The program sh
    6·1 answer
  • Is this even possible
    9·2 answers
  • Describe comm<br>unication cycle​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!