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
(3.01 MC)
faust18 [17]

Answer:

The answer to this question is given below in the explanation section. However, the correct answer is C.

Explanation:        

In pyton tutrle graphic library is used to draw lines and graphics. So, Madison should use the turtile python library to show the rise and fall of stock prices in visual presentation (lines).

Other options are not correct because Python  use math module library for mathematical tasks, shape graphics library is used for drawing a graphic windows etc, while Video module library is used for video editing etc.

3 0
3 years ago
which option of the AutoCorrect tool enables you to add and delete words that do not follow abbreviation rules?
quester [9]

The replace text as you type is an option in the AutoCorrect tool that enables the user to add or delete words that do not follow abbreviation rules. Moreover, this is a convenient way to use especially if you are dealing with long string of words that only needs abbreviation.

3 0
3 years ago
Read 2 more answers
Your personality is that of everyone else
lubasha [3.4K]

hmmmmm but is it really

5 0
3 years ago
Read 2 more answers
1. What is the difference between a group and a topic?
kap26 [50]
<h3>What is the difference between group and a topic ?</h3>

<h3>Group</h3>
  • You can publish a comment or question to the main community feed or to a group of which you are a member. Members with a common interest can form group within the wider community to form a small community around that topic and group posts will only appear in the feeds of other group members, not in the general community feed.
<h3>Topic</h3>
  • Topic work similarly to hashtags. Use the "+" symbol to the left of the Post/Ask button to add a topic (tag) to your post or question so that it can be classified along with other related posts and topics are a way to group posts and queries with similar content, but they don’t bring everyone with the same interest together in one place and this is where the groups come in!
7 0
2 years ago
Most people prefer to pay health insurance premiums rather than pay out of pocket for medical expenses because
oksano4ka [1.4K]
They may not have enough money for the bill at the time, and its easier to pay for insurance for unseen medical procedures.
7 0
3 years ago
Read 2 more answers
Other questions:
  • A disk rotates at a rate of 7200 revolutions per minute. Seek operations (i.e., moving the access head to a desired track) take
    6·1 answer
  • What are the commands used in windows 2012 to mount the nfs share on the linux server?
    8·1 answer
  • The right headlight does not function on either high or low beam. Technician A says this could be caused by an open ground on th
    12·1 answer
  • Which of the following is true regarding packaged software and custom software? Group of answer choices Packaged software are ap
    13·1 answer
  • A Chief Information Security Officer (CISO) needs to establish a KRI for a particular system. The system holds archives of contr
    13·1 answer
  • What operating system is an open source program
    15·1 answer
  • What is the hexadecimal equivalent of the decimal number 256?
    11·1 answer
  • You are a network engineer tasked with performing a site survey for a multiple-channel architecture (MCA) system in a three-stor
    11·1 answer
  • Good ways to increase sales on phone accesories?
    10·2 answers
  • "If a user on a laptop complains that they are unable to sign into Windows even though they are certain they are entering the co
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!