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 should be done with equipment that is at the end of its life cycle and that is being donated to a charity?
Solnce55 [7]

Answer: C) Sanitize it

Explanation:

The system and equipment needs sanitization when it reach at the end of the life cycle and must ensure that they does not included any type of the sensitive data. As, sanitization is the process of remove and destroy all the data store in the memory device.    

Removing CD and DVDs is also the part in sanitation but many other element such as disk drive needs to be checked to ensure that they does not contain any type of information or data.

Removing all the software license and installing the original software, they both are not necessary require in the sanitization process.

Therefore, Option (C) is correct.

7 0
4 years ago
What programming language is used for Arduinos?
Helen [10]

For Arduinos, C++ wrappers around C are used. The goal is to hide the details with setting up and using the AVR, therefore, it's a pretty simple program.

Answer: C++

(P.S. copy and paste your question into google or safari and click on the link to reddit because there's a lot of good info about this there)

+ = <3

4 0
3 years ago
Read 2 more answers
put together a shopping list of items that a first responder should always have at immediate disposal in a field kit. Using curr
Viefleur [7K]

Answer:

dont forget the trail mix

Explanation:

honestly you can go bougie or you can go doomsday prepper macgyver style.

Ill give you what I would bring as a field medic but you didnt really specify the situation so hopefully this can spark some ideas for your project. You can find everything here on amazon so ill let you go ahead and do that..

<u>PPE</u>

gloves

masks

eye protection

reflective wear

weapon system

<u>Medical</u>

Tourniquets

Pressure Dressings

NSAIDs

Aspirin

Safety pins

IO drill

IV supplies

Space blanket

Thermometer

Chapstick

Silktape

Bacitracin

<u>EDC</u>

Flashlight

Pens/markers

write in the rain

Firestarter

Duct tape

knives/trauma shears

saw

Watch

550cord

gummy worms & water

Radio/ Garmin inreach

Triage tags

3 0
3 years ago
I need help with this work
lisabon 2012 [21]

Answer:

B. Balanced depending and the type of questions

5 0
3 years ago
Which of the following might be appropriate to be created as a constant variable?
jasenka [17]

Answer:

Number of feet in a mile

Explanation:

In this problem, we need to find an option that to be created as a constant variable.

In option (a) "number of feet in a mile".

As 1 mile = 5280 foot

The number of feet in a mile is constant in every condition.

In option (b), (c) and (d)

number of people inside a store , current grade in a class , score in a football game are no fixed. It is not created as a constant variable.

Hence, the correct option is (a).

7 0
3 years ago
Other questions:
  • How can investors receive compounding returns
    13·1 answer
  • A network that operates without relying on a server is the ________ network.
    6·1 answer
  • Which kind of image is indispensable and needs added text to go with it? A. a map B. a chart C. a graph D. a photograph
    9·2 answers
  • You are considering creating a mobile app. Describe a basic statement for the app you would create and whether your app should b
    7·1 answer
  • A technician has been told that a keyboard is not responding at all. What can the technician do quickly to determine whether tha
    9·1 answer
  • How many keys are utilized in symmetric cryptography?A. OneB. TwoC. ThreeD. Four
    10·1 answer
  • How do you code a website?
    10·1 answer
  • Time
    6·1 answer
  • Which key doesn't relate to keyboard A:return key B :enrollment key C: delete key D:tab key
    9·2 answers
  • Please help me asapppp!​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!