Assuming outputDiv element has no initial text in it, what will be its text contents after the code above executes?

computer science

Description

 Examine the code segment below:


  1. Assuming outputDiv element has no initial text in it, what will be its text contents after the code above executes?


  2. (20 pts) Complete the function of the web page, multiples.html, so that it displays the number of multiples of a desired number. Below are two examples:

 

    1. You must use a loop. Since you know exactly how many times to execute the loop, which kind of loop would be best (while or for loop)?

    2. The output results of a previous calculation must be cleared each time the user clicks the Calculate button. One easy way to do this is by setting the innerHTML of the output element to an empty string such as “” or ‘’;







  1. (20 pts) Complete the function of the web page, car-depreciation.html, so that it displays the declining value of a vehicle given the starting value. The value of the car is assumed to decrease by 15% each year. The value of the car is printed for every year until the value is below 10% of the original car value. The value of the car must always be printed with 2 or fewer decimal places. Below are two examples:

    Example 1:



            Example 2:


Related Questions in computer science category