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
Brainliest
olya-2409 [2.1K]

Answer:

browsing history

Explanation:

....

6 0
3 years ago
Read 2 more answers
true or false? to change document properties, first tap or click file on the ribbon to open the properties view.
m_a_m_a [10]
I think its true but not sure
3 0
3 years ago
Read 2 more answers
What kind of attack allows for the construction of LDAP statements based on user input statements, which can then be used to acc
abruzzese [7]

Answer:   b. LDAP injection

Explanation:

LDAP (Lightweight Directory Access Protocol ) Injection is defined as

  • an injection attack used by attacker to exploit web based applications by inserting LDAP statements based on user input.
  • It may be possible modify LDAP statements through some techniques if an application fails to properly sanitize user input.

So,<u> LDAP injection</u> is the attack that allows for the construction of LDAP statements based on user input statements, which can then be used to access the LDAP database or modify the database's information.

Hence, the correct option is b. LDAP injection.

4 0
3 years ago
What was Ada Lovelace's contribution to computer science?
Alika [10]

Answer:

She made the first computer.

Explanation:

Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer, chiefly known for her work on Charles Babbage 's proposed mechanical general-purpose computer, the Analytical Engine.

8 0
2 years ago
Read 2 more answers
Deirdre has a hearing disability. One of her friends advised her to use real-time text or RTT on her phone. In which of these
ozzi

The way that real-time text or RTT on her phone can help her is that;

C: On phone calls, it will convert speech into text

<h3>Speech to Text</h3>

We are told that Deirdre has a hearing disability. This means that she has difficulty in hearing words clearly but can read.

Thus, from her friends advice about real time text or RTT, it will aid her because whenever someone calls her on the phone, it can convert the content of the call speech into text.

The missing options are;

A. It will make her phone vibrate to notify her when she gets a phone call

B. It will make her phone vibrate to notify her when she gets a text message.

C. On phone calls, it will convert speech into text. D. While text messaging, it will convert text into speech

Read more on speech to text at; brainly.com/question/2375490

5 0
2 years ago
Other questions:
  • What block cipher mode of operation involves each ciphertext block being fed back into the encryption process to encrypt the nex
    12·1 answer
  • Design and implement a class Country that stores the name of the country, its population, its area, and the population density (
    6·1 answer
  • Explain the term remote backup with examples.​
    5·1 answer
  • What is the output of the second println statement in the main method? public class Foo { int i; static int s; public static voi
    14·1 answer
  • Why would an IT technician ever have to change out a computer’s motherboard?
    5·2 answers
  • In which of the following situations will a macro make your work more efficient?
    9·1 answer
  • _____ can render data useless to unauthorized users who might have violated some of the database security layers.
    7·1 answer
  • I still haven't figured out how to award someone branliest will someone help me? If you explain to me how to do it i will do awa
    14·1 answer
  • What are some examples of productions categorized as non-broadcast productions?
    6·1 answer
  • Which type of internet connection allows for high-speed bi-directional data communication over a hybrid fiber-coaxial (HFC) conn
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!