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
melamori03 [73]
3 years ago
14

What is the value of the average variable after the following code is executed? var sum = 0; var prices = [14, 10, 9, 12, 11, 14

, 10, 8]; for( var i = 0; i < prices.length; i++ ) { sum = sum + prices[i]; } var average = sum/prices.length;
Computers and Technology
1 answer:
Reika [66]3 years ago
4 0

Answer:

The value of average is 11

Explanation:

Analyzing the program line by line

This line initializes sum to 0

var sum = 0;

This line defines an array named prices and it also fills it with integer values.

var prices = [14, 10, 9, 12, 11, 14, 10, 8];

The italicized lines is an iteration that adds every element of prices and saves the result in variable sum

<em>for( var i = 0; i < prices.length; i++ ) { </em>

<em>sum = sum + prices[i]; </em>

<em>}</em>

At this point, the value of sum is 88

The next line divides the value of sum (88) by the length of the array (8) which gives 11.

11 is then saved in variable average

var average = sum/prices.length;

You might be interested in
Translate the following pseudocode for randomly permuting the characters in a string into a C++ program.
Svetllana [295]

Answer:

d

Explanation:

salak sensin kolay gelsin

6 0
2 years ago
The CPU's control unit retrieves the next instruction in a sequence of program instructions from main memory in the ______ stage
Varvara68 [4.7K]

Answer:

A. Fetch.

Explanation:

The fetch-decode-execute process of simply the fetch-execute process of the CPU are stages the CPU follow to process information and the switch state or shutdown.

The stages of this process is implied in its name, that is, the stages are fetch, decide and execute.

The fetch stage retrieves the next instruction from the memory.

The decode stage converts the clear text instruction set to electronic signals and transfer it to the appropriate registers.

The execute stage is the action carried out in the arithmetic logic unit.

5 0
3 years ago
It is used between two or more computers. One computer sends data to or receives data from another computer directly.
dmitriy555 [2]

Answer:

File transfer protocol (FTP)

Explanation:

An information can be defined as an organized data which typically sent from a sender to a receiver. When a data is decoded or processed by its recipient it is known as information.

Generally, there are several channels or medium through which an information can be transmitted from the sender to a receiver and vice-versa. One of the widely used media is the internet, a global system of interconnected computer networks.

There's a standard framework for the transmission of informations on the internet, it is known as the internet protocol suite or Transmission Control Protocol and Internet Protocol (TCP/IP) model. One of the very basic rule of the TCP/IP protocol for the transmission of information is that, informations are subdivided or broken down at the transport later, into small chunks called packets rather than as a whole.

The three (3) main types of TCP/IP protocol are;

I. HTTP.

II. HTTPS.

III. FTP.

File transfer protocol (FTP) is used between two or more computers. One computer sends data to or receives data from another computer directly through the use of network port 20 and 21.

4 0
2 years ago
List any two features of this computer
zaharov [31]

Answer:

John Mauchy 1. designed to be a stored-program computer 2. it was binary rather than decimal

3 0
2 years ago
Which statement correctly defines the function of a servo
____ [38]

Answer:

B . It amplifies the power to speed up the motor and generate more torque

6 0
2 years ago
Other questions:
  • What allows people to create their own radio shows over the internet?
    14·1 answer
  • andy accidentally saved a file in the wrong folder. what is the quickest way to move the file? create a new file and save it in
    8·2 answers
  • Which type of electronic community displays discussions on different topics in threads?
    8·1 answer
  • Different video files and ______ can cause compatibility issues to arise between computer systems.
    8·1 answer
  • Why is the most important factor for investors always the quality of the venture's leadership team
    12·1 answer
  • Help please<br>x + 1 = –x + (–5)​
    7·1 answer
  • Given three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolut
    12·1 answer
  • A disk drive has 2000 cylinders, numbered 0 to 1999. The drive is currently servicing a request at cylinder 783, with the previo
    6·1 answer
  • How do you mark answers brainliest?<br> it looks like they changed it and now idk how to
    12·1 answer
  • Why does python code generate fewer types of syntax errors than code in other programming languages?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!