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
Dafna1 [17]
3 years ago
6

Calculating mean for even number and use while looppleas help me ​

Computers and Technology
1 answer:
vladimir2022 [97]3 years ago
8 0

Answer:

Here is my answer in Javascript

num = 0;   // Use to calcate the even numbers

loop = 10; // Use for the highest even number that will be calcated for

index = loop/2; // Calcate the size of the array based upon how many loops their

let arr = [index]; //Create array to store the even numbers

let i = 0; // Use to keep track of which on what number in the while loop we are on  

let total = 0; //Used to add up all of the even numbers

let mean = 0; //Used to calcate the mean of all even numbers

do {

 i = i + 1; //Keep track of what loop we are on

 num = num + 2; //Used to calcate the even number

 arr.push(num); //Push the num into a array

 total = total + arr[i]; //Calcate the total of the array

 mean = total / i; //Calcate the mean

}

while (num != loop);

//Output the result

console.log(mean);

You might be interested in
WHAT ARE THE RISK OF DUST​
Step2247 [10]

Answer:

over heating

Explanation:

in computers dust acts as a blanket which traps heat, excessive heat causes components to burn up and short out

3 0
3 years ago
If a file is opened for reading and the file does not exist,what action is taken?
worty [1.4K]

Answer:

C)An error message is issued.

Explanation:

If we try to open a file for reading when that file does not exist, we will get an error message.

For example, in Java we will encounter a FileNotFoundException as in the code below:

       try {

           FileInputStream fis = new FileInputStream("myFile.txt");

           DataInputStream dis = new DataInputStream(fis);

           BufferedReader br = new BufferedReader(new InputStreamReader(dis));

           String str = null;

           while ((str = br.readLine()) != null) {

               System.err.println(str);

           }

       } catch (FileNotFoundException e) {

           e.printStackTrace();

       }

If the file myFile.txt does not exist we can expect to see an exception stack trace corresponding to FileNotFoundException.

8 0
4 years ago
C++ question:
gogolik [260]
There's no "using namespace std;" statement. I see no reason for COLOR to be two dimensional or have a length of 5 with only four elements. The inside of the for loop with variable 'J' makes no sense.
3 0
3 years ago
Read 2 more answers
Which of the following is a good way to improve your credit score?
Ganezh [65]
The answer is chope this helps
6 0
3 years ago
What controls are available on the ribbon in a contact window
sergij07 [2.7K]

Contact solution is the answer and the work is your brain
8 0
4 years ago
Other questions:
  • Assume you're using a 3 button mouse. to access shortcut menus, you would
    6·2 answers
  • Derek has an interest in designing video games. What requirements should he fulfill to be a game designer?
    11·1 answer
  • What type of multimedia is a game CD? Game CDs are examples of ___ multimedia.
    15·2 answers
  • one_diff(a?): Description: Determine if there is exactly one character different between exactly two strings. Parameters: Determ
    5·1 answer
  • Which of the following things could you do in order to tell if a pair of colors has strong contrast? A. Look at the colors on th
    12·1 answer
  • What does it mean to catch an exception?
    8·1 answer
  • NEED HELP ASAP
    13·2 answers
  • These operating systems use a graphical user interface.
    8·1 answer
  • On the worksheet, make cell a1 the active cell and then simultaneously replace all occurrences of the value 0. 05 with the value
    12·1 answer
  • In a(n) ____________________ device, the movement of electrons performs essentially the same functions as gears and wheels in me
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!