(a)
To create a Date object that contains the date May 19, 2018 at 9:31:27 a.m and store it in the variable named thisDay.
(b)
To declare two variable named localDate and localTime. The localDate variable contains the text of the date from the thisDay variable using local conventions. The localTime variable contains the text of the time stored in the thisDay variable using local conventions.
(c)
To write the code for datetime where date and time are the values of the localDate and localTime variables, Within the inner HTML of the page element with the ID currentTime.
(d)
To Call the nextJuly4() function using thisDay as the parameter value and store the date returned by the function in the j4Date variable..
(e)
To apply the setHours() method to the j4Date variable to change the hours value to 9 p.m..
(f)
To create variables named days, hrs, mins, and secs containing the days, hours, minutes, and seconds until 9 p.m. on the next 4th of July.
(g)
To Change the text content of the elements with the IDs “dLeft”, “hLeft”, “mLeft”, and “sLeft” to the values of the days, hrs, mins, and secs variables rounded down to the next lowest integer.
Trending nowThis is a popular solution!
Chapter 9 Solutions
New Perspectives on HTML5, CSS3, and JavaScript
- Which of the following is used to convert Date object to String? a) SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.parse(new Date()); b) SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); sdf.format(new Date()); c) SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().parse(); advertisement d) SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); new Date().format();arrow_forward1. The main function creates 5 pixels with random red, green, and blue values. Complete the id_color function to return “red” if the red value is greater than the green and blue, “green” if the green value is greater than the red and blue, and “blue” if the blue value is greater than the red and green. If there is no clear maximum value (for example, if the red and green values are the same) return None. Do not change the main function.arrow_forward1. The main function creates 5 pixels with random red, green, and blue values. Complete the id_color function to return “red” if the red value is greater than the green and blue, “green” if the green value is greater than the red and blue, and “blue” if the blue value is greater than the red and green. If there is no clear maximum value (for example, if the red and green values are the same) return None. Do not change the main function. import imageimport random def id_color(p):'''Returns the dominant color of pixel p'''pass#Your code here to determine the dominant color and return a string identifying it#Hint: get the red, green & blue values and use an if statement to determine which has the highest value def main():'''Controls the program'''for i in range(5): #Loop 5 timesr = random.randrange(0, 256)g = random.randrange(0, 256)b = random.randrange(0, 256)print(r, g, b) #Show the pixel red, green & blue valuesnew_pixel = image.Pixel(r, g, b)print(id_color(new_pixel)) main()…arrow_forward
- Form validation aims to make the user comfortable while downloading images from websites. O True False QUESTION 8 The isNaN() function verifies whether a value is an illegal number. O True O False QUESTION 9 Moving a mouse over an element is an example of events. O True O Falsearrow_forwardIn this exercise, you modify one of the Seminars applications from Chapter 4’s Apply lesson. Open the Seminars Solution.sln file contained in the Seminars Solution-CheckBox folder. Create an event-handling Sub procedure named ClearAmountDue and associate it with each check box’s CheckChanged event. Then, create a function that determines which (if any) check boxes are selected and then adds the associated fee to the total due. The function should return the total due to the statement that invoked it. Also, make the necessary modifications to the btnCalc_Click procedure’s code. Save the solution and then start and test the application. In VB please. Code Given: Option Explicit OnOption Strict OnOption Infer Off Public Class frmMain Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click' Calculate and display the amount due. Dim intAmountDue As Integer ' Determine which (if any) check boxes are selected' and add the associated fee to the amount due.If…arrow_forwardPlease help for each proble stey by step and with a final code for understanding thank you.arrow_forward
- Extra 6-1 Develop the Temperature Converter In this exercise, you’ll use radio buttons to determine whether the conversion is from Fahrenheit to Celsius or vice versa. You’ll also modify the DOM so the labels change when a radio button is clicked, and the page displays an error message when the user enters invalid data. 1. Open the application in this folder: exercises_extrach06convert_temps 2. Note that the JavaScript file has some starting JavaScript code, including the $() function, three helper functions, three event handler functions, and a DOMContentLoaded event handler that attaches the three event handlers. 3. Review how the toCelsius() and toFarhenheit() event handler functions call the toggleDisplay() helper function and pass it strings to display. Also note that the toggleDisplay() helper function and the convertTemp() event handler function are incomplete. 4. Code the toggleDisplay() function so it changes the text in the labels for the text boxes to the values in the…arrow_forwardCs10-8 A19 3Q2122 FALL BIMT) WEEK 4 Math Expression with Variables (with log, exp and trig functions) My Solutions> Code has aiready been provided to create the four variables a, b, c, and d. Add commands to evaluate the following expressions using these variables and assign the results to the indicated variable names: A,a cosc+d Assign the result for A, to the variable Answeri. Note that the values of b, c, and d defined in the given code are all in radians. 4,=d-In/ Assign the result for Az to the variable Answer2. Note the absolute value of the argument to the logarithm. sin +4)) Assign the result for A, to the variable Answer3. Note that e in this expression is the exponential function. Script e H Save C Reset E MATLAB 1 %Define variables a, b, c, and d 2 a = 2.2; 3b = 5.1; 4 C = -3.13; 5 d = 1.8; 6 7 %Enter commands to evaluate the expressions and assign the results 8%to the variable names given in the problem statement. Note the values of the variables 9 %a, b, c, and d are…arrow_forwardIn cell B6 in the Purchasing sheet, insert the payment function to calculate the monthly payment using cell references, not numbers, in the function, and make sure the function displays a positive result. Apply Accounting Number Format and the Output cell style to cell B6.arrow_forward
- // write code to make the prompt field editable when the edit button is clicked (notice the input elements are set to read only at the moment) value="EDIT PROFILE" title="Edit" type="button" style="float: right;"> First Name: Last Name: Institution: Street: Apt: City: State: Zip Code: Age: Phone number: Email: Password:arrow_forwardThe parameter that you entered is incorrect. Image size is not supported at this time. The width and height of each picture must be between 40 and 2600 pixels.arrow_forwardIf the strName variable contains the string “Sharon Kelper”, which of the following changes the contents of the variable to the string “Sharon P. Kelper”? a. strName = strName.Insert(6, " P.") b. strName = strName.Insert(7, " P.") c. strName = strName.Insert(8, "P. ") d. None of the above.arrow_forward
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage