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
When law enforcement becomes involved, the need may arise to freeze systems as part of the evidence. There is also the likelihoo
Sindrei [870]

Answer:

Costs will cover a need for more customer data. The further explanation is given below.

Explanation:

  • It's the greatest problem for almost every company to provide the data with security.
  • This is possible for highly trained practitioners and the technical staff to take charge of it.
  • Complicated technologies would have been going to run together again to withstand these types of jobs.
  • Such problems play a major part in the decision-making process affecting the law enforcement authorities to locate the suspects to strengthen the organization.
  • To do something like this, there seem to be a lot of other good initiatives out there doing it.

There have been some cases in which major corporations have chosen not to include law enforcement:

  • There are many more electronic corruption going on, including money robbery, asset fraud, as well as machine assaults.
  • In such a bigger case, numerous institutions, such as large-scale ones, have gone through these circumstances to evaluate law enforcement to come to terms with cybersecurity.
5 0
3 years ago
You notice that lately your computer has been running slow. When you open up your web browser, you get endless pop-up ads to the
Vlad [161]

Answer:

Spyware

Explanation:

The reason why you noticed your computer has been running slow is because of spyware, which is considered to be very bad to get on your computer. When a user opens his/her web browser, the user receives ads that are misleading to the user, which fools the user of thinking it's something real and not a scam. Not only that, the user also receives pop-up ads that can, as mentioned, trick the user to think that it's real and not fake. Finally, the user's search results will be manipulated. In conclusion, spyware is, in fact, the main cause of the scenario.

4 0
3 years ago
Explain approaches of AI​
Umnica [9.8K]
A-artificial I-intelligent
5 0
2 years ago
Read 2 more answers
2. Feet to Inches One foot equals 12 inches. Design a function named feetToInches that accepts a number of feet as an argument,
MariettaO [177]

Answer:

See the below the answer written in Matlab

Explanation:

function inches=feetToInches(feet)

prompt='enter the value of feet in digits';

feet=input(prompt)% ask for the value in feet that needs to be converted to inches

inches =feet*12; % converts feet to inches

x=['the value in inches is:  ',num2str(inches)];

disp(x) %display the result of the convertion

end

8 0
3 years ago
Hidden-surface removal is the process of:
castortr0y [4]

Answer:

Option A.

Explanation:

In 3D computer graphics, this process determines which elements should not be visible from the desired point of view, and will prevent them from rendering. Thus, objects that lie behind opaque surfaces such as walls or panels, will not be rendered.

A good rendering algorithm helps to optimize the graphic engine because it will load as few elements as possible. Therefore, in larger worlds, the engine will remain at a stable speed and will be more efficient.

3 0
3 years ago
Other questions:
  • What is the term for the process of gathering information through images taken at a distance?
    13·1 answer
  • Why do clocks tick-toc?
    5·2 answers
  • What daily life problems does the algorithm quicksort solve?
    14·1 answer
  • What is the post condition of an expression or variable
    11·1 answer
  • When looking at a relationship between two tables on an ERD, the _____ table can be identified by the presence of a foreign key
    8·1 answer
  • How do I type the integral symbol?
    6·1 answer
  • 3. Discuss microprocessor components, chips,
    15·1 answer
  • Need Help Please
    7·1 answer
  • You have a filtered dataset for Customer Sales with some null value rows. You want to remove these rows completely. How will you
    15·1 answer
  • PLEASE HELP! I accidently looked up a link, and now this same link keeps popping up everywhere, how do I stop this!?!? please he
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!