Answer:
Hi!
var count =0; <em>//initialize count.</em>
var sevens =0 ; <em>//initialize sevens.</em>
while(count<100) <em>// loops while count is minor than 100. *counts never add 1 at the final of the loop, so this while is always true. </em>
{
<em>//Math.floor(x) round to the max Integer a number. Example : 45.90 -> 46.</em>
<em>//Math.random() returns a number between [0, 1).</em>
var roll1 = Math.floor(Math.random()*6+1); <em>//Gets a integer using Math.random(), adds 1, and round it withMath.floor() then saves in roll1.</em>
var roll2 = Math.floor(Math.random()*6+1); <em>//Gets a integer using Math.random(), adds 1, and round it withMath.floor() then saves in roll2.</em>
if(roll1 + roll2 == 7)
<em> //If the sum of roll1 and roll2 is 7 adds 1 to sevens.</em>
sevens = sevens +1;
}
<em>//*count is not incremented, so while(count<100) -> always true.</em>
Answer:
- var projected_fee = 6000;
-
- for(var i = 1; i <= 5; i++){
- projected_fee = projected_fee * 0.02 + projected_fee;
- console.log("$" + projected_fee.toFixed(2));
- }
Explanation:
Firstly, create a variable, projected_fee, and set the initial tuition fee value to it (Line 1).
Next, user a for loop that run for 5 times to repeatedly calculate the projected_fee based on 2 percent of increment rate (Line 4) and display the projected fee to console terminal (Line 5). The output should be
$6120.00
$6242.40
$6367.25
$6494.59
$6624.48
Answer: Internet Protocal (IP)