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
Jessie will make and sell the trending Baked California Maki. Her Peso mark up is 5.00. Selling price PHP 15.000. How much will
Levart [38]

Answer:

50%

Explanation:

The markup is the difference between the selling price and the cost price. If the mark up is greater than zero, it means there is a profit, if the markup is less than 0, it means there is a loss and if the markup is equal to 0, it means there is breakeven.

Percentage markup = (markup/cost price) * 100%

Selling price - cost price = markup

15 - cost price = 5

cost price = 10

Percentage markup = (markup/cost price) * 100% = (5/10) * 100% = 50%

7 0
3 years ago
(TCO B) The symbol shown as a three-sided box that is connected to the step it references by a dashed line is what?
Mekhanik [1.2K]

Answer:

Annotation symbol

Explanation:

A flowchart is a diagram that is used to show and represent a workflow, process or algorithm. Flow charts are used in designing processes or programs. Flow charts are usually designed using boxes and arrows.

An annotation symbol is a symbol used in flowchart to hold comments and it is usually represented by a three-sided box connected to the step it references by a dashed line.

7 0
2 years ago
Write a function number_of_pennies() that returns the total number of pennies given a number of dollars and (optionally) a numbe
katovenus [111]

Answer:

The function is as follows:

def number_of_pennies(dollars,pennies=0):

   return dollars*100+pennies

   

Explanation:

This defines the function

def number_of_pennies(dollars,pennies=0):

This returns the number of pennies

   return dollars*100+pennies

<em>Note that, if the number of pennies is not passed to the function, the function takes it as 0</em>

5 0
2 years ago
Read 2 more answers
True or false :User intent refers to what the user was trying to accomplish by issuing the query
shepuryov [24]

Answer:

answer: User intent is a major factor in search engine optimisation and conversation optimisation. Most of them talk about customer intent ,however is focussed on SEO not CRO

Explanation:

hope we can be friends

can i please get brainliest

3 0
3 years ago
____ is the phase of a technology cycle characterized by technological substitution and design competition. question 9 options:
lilavasa [31]
Innovation streams is the answer i believe


6 0
3 years ago
Other questions:
  • Jack wants to store a large amount of data on his computer. He chooses to use a database for this purpose. What is a database? A
    8·1 answer
  • To differentiate the absolute pathnames to files that are located on different drives, html requires you to include the drive le
    8·1 answer
  • Which of the following is a useful policy to minimize waste and mistakes?
    6·1 answer
  • if the president goes for vice president after his 2 term and the present president dies is the old president the president agai
    8·2 answers
  • What are two fundamental components of data structures?
    10·1 answer
  • Which of the following is not a good technique for photographing groups? Visiting the location.
    9·1 answer
  • You have four DCs in your domain. Active Directory appears to be corrupted on one of the DCs, and you suspect a failing hard dri
    5·1 answer
  • Which peripheral device is used to record sound?
    14·2 answers
  • Jack used primarily web sources for his informative speech about gun control. however, his over-reliance on the web site sponsor
    11·1 answer
  • What are the concerns surrounding 5G cellular networks?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!