New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN: 9781305503922
Author: Patrick M. Carey
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Question
Chapter 9, Problem 15CP1
Program Plan Intro
To modify the statement that create thisTime variable in order to store current date and time.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Go to your main.py file.
On the first line, add a docstring explaining what your file does. Then, assign a variable called whole_num to the user’s input and cast it to an integer.
Next, print 10 underscores as the top border of the table.
On the first line print your whole number, then multiply your whole number by multiples of 2's till 10 and print that out.
Finally, print 10 underscores again for the bottom border of the table, as in step 3.
Run the file by using the python3 main.py command.
Return to the links.js file in your editor and create an event listener for the load event that runs an anonymous function.
Within the anonymous function, create the allSelect variable referencing all select elements nested within the govLinks form.
Loop through the allSelect object collection and for each selection list in the collection create an anonymous function for the onchange event. Within this anonymous function, use the href property of the location object to change the page shown in the browser window to the value of the target of the event object that initiated the onchange event.
Document your commands with JavaScript comments.
Event Listeners
Go to the co_credit.js file in your editor. Create an event listener for the window load event that retrieves the field values attached to the query string of the page’s URL. Add the following to the event listener’s anonymous function:
Create the orderData variable that stores the query string text from the URL. Slice the orderData text string to remove the first ? character, replace every occurrence of the + character with a blank space, and decode the URI-encoded characters.
Split the orderData variable at every occurrence of a & or = character and store the substrings in the orderFields array variable.
Write the following values from the orderFields array into the indicated fields of the order form:
orderFields[3] into the modelName field
orderFields[5] into the modelQty field
orderFields[7] into the orderCost field
orderFields[9] into the shippingType field
orderFields[13] into the shippingCost field
orderFields[15] into the subTotal field
orderFields[17]…
Chapter 9 Solutions
New Perspectives on HTML5, CSS3, and JavaScript
Ch. 9.1 - Prob. 2QCCh. 9.1 - What is the difference between asynchronously...Ch. 9.1 - Provide the command to display an alert dialog box...Ch. 9.1 - Prob. 8QCCh. 9.2 - Prob. 6QCCh. 9 - Prob. 2RACh. 9 - Prob. 4RACh. 9 - Prob. 5RACh. 9 - Prob. 6RACh. 9 - Prob. 7RA
Ch. 9 - Prob. 8RACh. 9 - Prob. 9RACh. 9 - Prob. 10RACh. 9 - Prob. 11RACh. 9 - Prob. 1CP1Ch. 9 - Prob. 2CP1Ch. 9 - Prob. 3CP1Ch. 9 - Prob. 4CP1Ch. 9 - Prob. 5CP1Ch. 9 - Prob. 6CP1Ch. 9 - Prob. 7CP1Ch. 9 - Prob. 8CP1Ch. 9 - Prob. 9CP1Ch. 9 - Prob. 10CP1Ch. 9 - Prob. 11CP1Ch. 9 - Prob. 12CP1Ch. 9 - Prob. 13CP1Ch. 9 - Prob. 14CP1Ch. 9 - Prob. 15CP1Ch. 9 - Prob. 16CP1Ch. 9 - Prob. 1CP2Ch. 9 - Prob. 2CP2Ch. 9 - Prob. 3CP2Ch. 9 - Prob. 4CP2Ch. 9 - Prob. 5CP2Ch. 9 - Prob. 6CP2Ch. 9 - Prob. 7CP2Ch. 9 - Prob. 8CP2Ch. 9 - Prob. 9CP2Ch. 9 - Prob. 10CP2Ch. 9 - Prob. 11CP2Ch. 9 - Prob. 12CP2Ch. 9 - Prob. 13CP2Ch. 9 - Return to the bc_today.js file and change the...Ch. 9 - Prob. 15CP2Ch. 9 - Prob. 1CP3Ch. 9 - Prob. 2CP3Ch. 9 - Prob. 3CP3Ch. 9 - Prob. 4CP3Ch. 9 - Prob. 5CP3Ch. 9 - Above the randomlnt() function insert a command to...Ch. 9 - Prob. 7CP3Ch. 9 - Prob. 8CP3Ch. 9 - Prob. 9CP3Ch. 9 - Prob. 10CP3Ch. 9 - Prob. 2CP4Ch. 9 - Prob. 3CP4Ch. 9 - Prob. 4CP4Ch. 9 - Prob. 5CP4Ch. 9 - Prob. 6CP4Ch. 9 - Prob. 7CP4Ch. 9 - Prob. 8CP4Ch. 9 - Explore 9. Scroll back to the top of the file and,...Ch. 9 - Prob. 10CP4Ch. 9 - Prob. 13CP4
Knowledge Booster
Similar questions
- Return to the bc_today.js file and change the value of the thisDate variable so that it uses the current date and time.arrow_forwardEvent Listeners Return to the mas_register.js file in your editor. Directly below the initial comment section, insert an event listener for the window load event. Run an anonymous function in response to the event containing the following commands: Call the calcCart() function (which you will create shortly.) Create an onclick event handler for the regSubmit button that runs the sessionTest() function when the button is clicked. Create onblur event handlers for the input boxes with the ids: fnBox, lnBox, groupBox, mailBox, phoneBox, and banquetBox, running the calcCart() function in response to each event. Create an onchange event handler for the sessionBox selection list, running the calcCart() function when the selection list is changed. Create an onclick event handler for the mediaCB check box, running the calcCart() function in response. JavaScript Functions Create the sessionTest() function. The purpose of this function is to provide a validation test for the conference session…arrow_forwardNeed help with this. I attached how it should look Declare the questionList variable, storing in it the node list created by the querySelectorAll() method using “div#quiz input” as the CSS selector. Add an onclickevent handler to the startQuiz object, running an anonymous function that sets the class attribute of the overlay object to “showquiz” and repeats the countdown() function every 1 second (every 1000 milliseconds), storing the id of the timed command in the global timeID variable you declared in Step 3. Create the countdown()function to update the quiz clock. Within the function create an if else statement that tests whether the value of the timeLeft variable is equal to 0. If it is equal to 0, do the following: 0. Use the clearInterval()method to cancel the timed command with the variable timeID. Declare a…arrow_forward
- Event Listeners Go to the co_cart.js file in your editor. Directly below the initial comment section, add an event listener for the window load event that does the following when the page is loaded: Runs the calcCart() function. Add an event handler to the modelQty field in the cart form that runs the calcCart() function when the field value is changed. A for loop that loops through every option in the group of shipping option buttons, adding an event handler to run the calcCart() function when each option button is clicked. JavaScript Functions Create the calcCart() function to calculate the cost of the customer’s order using field values in the cart form. Within the calcCart() function do the following: Create a variable named orderCost that is equal to the cost of the espresso machine stored in the modelCost field multiplied by the quantity of machines ordered as stored in the modelQty field. Display the value of the orderCost variable in the orderCost field, formatted as U.S.…arrow_forwardCreate an Eclipse Java project that reads in the names and postal (Zip) code data for individuals from the attached "employee-2.txt Download employee-2.txt" file (note: you need to add the text file with the exact file name to the root "project folder" of your Eclipse Java project, not the "src" folder). In the attached text file, edit the last row manually to add your own First Name, Last Name and Zip code. Your project should read in the employee data provided in the text file and store the data into a LinkedList<Employee> data structure, for which, you need to write a Java class named "Employee.java" that defines a first name (type String), a last name (type String), a postal code (type int or String), an Employee "constructor" and a toString() method. You may optionally define "setters" and "getters" methods in the "Employee.java" class. You should write a separate driver class named "EmployeeListDriver.java" to implement the main() method, the main() method is where you…arrow_forwardUsing chart component create menu for chart and choose graphic for your chat. Use one button, dblclick on button, that will include the following operations: Quiz 30 color yellow, Midterm 30 color blue, Final 40 color green, the class will be held on 23.05.22 at 17:00, 10 color redarrow_forward
- In the langauage R: Which of the following statements is NOT correct about themes in R? Select one: Once set, a theme applies to all subsequent plots and remains active until it is replaced by a different theme The theme_set() function takes the name of a theme as an argument If we want to change the overall look of the figure all at once, we can use ggplot’s theme engine The theme_minimal() function can make ggplot output look like it has been featured in the Wall Street Journalarrow_forwardHelp me create the following function constraints in w04c_ans.py the test case file provided in one of the image is named w04c_test_public.py copy and paste it in notepad ++ for it to look exactly the same. w04c_test_public.py import ioimport textwrapimport unittestfrom unittest.mock import patch # TODO: Replace w04c_ans with the name of your Python file.# Make sure that this file and that file are in the same# folder.from w04c_ans import print_frame, is_valid_num class TestIsValidNum(unittest.TestCase): def test_pt01(self): a_test = is_valid_num('2') self.assertTrue(a_test) def test_pt02(self): a_test = is_valid_num('-5') self.assertFalse(a_test) def test_pt03(self): a_test = is_valid_num('512abc32') self.assertFalse(a_test) class TestPrintFrame(unittest.TestCase): @patch('sys.stdout', new_callable=io.StringIO) def test_pt01(self, mocked_print): print_frame() self.assertEqual(…arrow_forwardFill in blanks so that the code will print out the name for each data frame in the map document and the scale of the last data frame. You must use i for #4 and 5 answers. import arcpy mapdoc arcpy.mapping.MapDocument( r"C:\\Datal\Forida.mxd") Istdf = arcpy.mapping. ListDataFrames (mapdoc) i = 0 for df in Istdf: print df. name print str(Istdf [0] .scale)arrow_forward
- Please write this small R code: In the setup chunk,, add code to load the following 3 packages: tidyverse, plotly, and crosstalk. Recall that packages are loaded with the library function, e.g. Below these, add another line of code to read in the data from the pokemon.csv file using the read_csvfunction, and store it as a variable called pokemon. You should do this in setup chunk at the top of the Rmd file. (You can leave the columns as their default datatypes.) Make sure you use read_csv and not read.csv (read_csv is a more modern function that is part of the tidyverse).arrow_forwardPlotting assignment Create 4 subplots of y = x, y2 = x², y3 = x³, and y4 = Vx. Use 10 points between x = red circles, y2 = x2 use green dashes, y3 = x3 use blue triangles, and y4 = Vx use black squares. Also, give each subplot a title. Include a command to save the figure as a PNG file so that it can be imported into another program such as Microsoft PowerPoint. 0 to x: 10. For y1 = x use Show me the figure on the PNG filearrow_forwardThe csv file "house price.csv contains the basic Information about houses. Rerad the data from the csy file "house price.csv", and create a dataframe object. Plot the histogram chart and the density chart of the distribution of bedrooms (i.e. the column "bedrooms"). Plot the scatter chart of the relationship between the column "sqft Jiving" and the column "price". Pict the bar chart of the average selling price (Le. the column "price") of houses in different cities (Le. the calumn "city") and also compute the standard deviation. Plat the box chart of the selling price (ie. the column "price" )of houses in different cities (ie. the column "city"). In [2]: Import pandas as pd import matplotlib.pyplot as pit import seaborn as sns in [9]: #1 Read the data iffile ruth pathhouse price csv in [14] df = pd. read rsv ( path) df Out [14]: \table[[] date price,bedrooms, bathrooms.sqft_living,sqft lot, floors, waterfront, view,condition,sqft_above, sqft basement.yr_built yr_renovated], [0,…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- New Perspectives on HTML5, CSS3, and JavaScriptComputer ScienceISBN:9781305503922Author:Patrick M. CareyPublisher:Cengage LearningCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage