New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN: 9781305503922
Author: Patrick M. Carey
Publisher: Cengage Learning
Question
Book Icon
Chapter 9, Problem 8CP4

a)

Program Plan Intro

To declare a countdown() function, which will update the minsLeft, secsLeft, and timeLeft variables every second. This function should not have any parameters and it should calculate a new value for the minsLeft variable by dividing the timeLeft variable by 60 and using the Math.floor()method to round that value down to the next lowest integer in file ph_clock.js.

b)

Program Plan Intro

To calculate the new value for the secsLeft variable which is equal to the value of the timeLeft variable minus 60 times the minsLeft variable within the countdown()function in file ph_clock.js.

c)

Program Plan Intro

To create a minsString variable and setting its value equal to the value returned by the addLeadingZero() function by using minsLeft as the parameter value within the countdown()function in file ph_clock.js.

d)

Program Plan Intro

To create a secsString variable and setting its value equal to the value returned by the addLeadingZero() function by using secsLeft as the parameter value within the countdown()function in file ph_clock.js.

e)

Program Plan Intro

To change the text content to the value of the minsString variable within the element with the id minutes and to change the text content to the value of the secsString variable within the element with the id seconds within the countdown()function in file ph_clock.js.

f)

Program Plan Intro

To call the checkTimer()function within the countdown()function in file ph_clock.js.

g)

Program Plan Intro

To declare a decrement operator to decrease the value of the timeLeft variable by 1 within the countdown()function in file ph_clock.js.

Blurred answer
Students have asked these similar questions
Which of the following code elements is often removed at the end of a line? Why it is removed?
Need help with this   Create a function named FahrenheitToCelsius() containing a single parameter named degree. Insert a statement that returns the value of degree minus 32 and then divided by 1.8. Create a function named CelsiusToFahrenheit() containing a single parameter named degree. Insert a statement that returns the value of degree multiplied by 1.8 plus 32. Add an onchange event handler to the element with the id “cValue”. Attach an anonymous function to the event handler and within the anonymous function do the following: Declare a variable named cDegree equal to the value of the element with the id “cValue”. Set the value of the element with the id “fValue” to the value returned by the CelsiusToFarenheit() function using cDegree as the parameter value. Add an onchange event handler to the element with the id “fValue”. Attach an anonymous function to the event handler and within the anonymous function do the following: Declare a variable named fDegree equal to the value…
Q1. Write a reference, in VBA code, to each of the following ranges. (You can assume that each of these ranges is in the active worksheet of the active workbook, so that you don’t have to qualify the references by worksheet or workbook.) Here’s an example. Question: The cell one column to the right and two rows below Cell A1. Answer: Range (“A1”).Offset(2,1) The fifth cell of the range B1:B30. The cell at the intersection of the 25th row and 5th column of the range A1:Z100. The cell at the intersection of the 25th row and 5th column of the range that has been set to a Range object variable named SalesRange. The entire column corresponding to cell C5. A range of employee names, assuming the first is in cell B2 and they extend down column B (although you don’t know how many there are).   Q2. Write a VBA program (consisting of a single subroutine) to check existence of a given value in a list. Specifically, you are given a list of product IDs in column A, as follows:     You don’t know…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Text book image
CMPTR
Computer Science
ISBN:9781337681872
Author:PINARD
Publisher:Cengage
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L