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 10.1, Problem 2QC
Program Plan Intro
To write command to create an array dayNames by using the object constructor form.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Management has given you the greenlight to create the product portion of the web application.
Create a Product class with the following attributes:
a. Price
b. Name
c. Description
d. Id
Create a ShoppingCart.js file and include it in the products page. In the script, create an empty array to store the items added to the cart. Create a products array and create a product object for each of your products and store it in the products array when the script loads.
The shopping cart script should have the following functions:
a. add - Takes an id, finds the product object in the products array and adds it to the items purchased array.
b. remove - Takes an id and removes the corresponding object from the items purchased array.
c. Returns html for displaying the items in the cart.
Create a products.html page. Add 5 product images to the page. Under each product add an add to cart button. Make the id property of the button the id for the product.…
Which of the following is the correct description of the NumPy array created by the
following command:
myArray = np.zeros (4)
myArray is a shape (4,1) array, i.e. a column vector.
myArray is a shape (1,4) array, i.e. a row vector.
myArray is a shape (4,4) matrix.
myArray is a 1-D array of length 4.
Suppose you are using a jQuery animation to make an element change color when the user clicks on it, and you also want to execute a function as soon as the animation finishes running. How can you do this?
a.
Pass the function in as the first argument to theanimate()method called on the element.
b.
Use anif elseblock with thehasClass()method to determine when to call the function.
c.
Pass the function in as the final argument to theanimate()method called on the element.
d.
You cannot accomplish this using jQuery commands.
Chapter 10 Solutions
New Perspectives on HTML5, CSS3, and JavaScript
Ch. 10.1 - Prob. 2QCCh. 10 - Prob. 1RACh. 10 - Prob. 2RACh. 10 - Prob. 3RACh. 10 - Prob. 4RACh. 10 - Prob. 5RACh. 10 - Prob. 6RACh. 10 - Prob. 7RACh. 10 - Prob. 8RACh. 10 - Prob. 9RA
Ch. 10 - Prob. 10RACh. 10 - Prob. 11RACh. 10 - Prob. 12RACh. 10 - Prob. 1CP1Ch. 10 - Prob. 2CP1Ch. 10 - Prob. 3CP1Ch. 10 - Prob. 4CP1Ch. 10 - Prob. 5CP1Ch. 10 - Prob. 6CP1Ch. 10 - Prob. 7CP1Ch. 10 - Prob. 8CP1Ch. 10 - Prob. 10CP1Ch. 10 - Prob. 11CP1Ch. 10 - Prob. 12CP1Ch. 10 - Prob. 13CP1Ch. 10 - Prob. 14CP1Ch. 10 - Prob. 15CP1Ch. 10 - Prob. 1CP2Ch. 10 - Prob. 2CP2Ch. 10 - Prob. 3CP2Ch. 10 - Prob. 4CP2Ch. 10 - Prob. 5CP2Ch. 10 - Prob. 6CP2Ch. 10 - Prob. 7CP2Ch. 10 - Prob. 8CP2Ch. 10 - Prob. 9CP2Ch. 10 - Prob. 10CP2Ch. 10 - Prob. 11CP2Ch. 10 - Prob. 12CP2Ch. 10 - Prob. 13CP2Ch. 10 - Prob. 14CP2Ch. 10 - Prob. 2CP3Ch. 10 - Prob. 3CP3Ch. 10 - Prob. 4CP3Ch. 10 - Prob. 5CP3Ch. 10 - Prob. 6CP3Ch. 10 - Prob. 7CP3Ch. 10 - Prob. 8CP3Ch. 10 - Prob. 9CP3Ch. 10 - Prob. 10CP3Ch. 10 - Prob. 11CP3Ch. 10 - Prob. 12CP3Ch. 10 - Prob. 13CP3Ch. 10 - Prob. 14CP3Ch. 10 - Prob. 15CP3Ch. 10 - Prob. 16CP3Ch. 10 - Prob. 17CP3Ch. 10 - Prob. 1CP4Ch. 10 - Prob. 2CP4Ch. 10 - Prob. 3CP4Ch. 10 - Prob. 4CP4Ch. 10 - Prob. 5CP4Ch. 10 - Prob. 6CP4Ch. 10 - Prob. 7CP4Ch. 10 - Prob. 8CP4Ch. 10 - Prob. 9CP4Ch. 10 - Prob. 10CP4Ch. 10 - Prob. 11CP4Ch. 10 - Prob. 12CP4Ch. 10 - Prob. 13CP4Ch. 10 - Prob. 14CP4
Knowledge Booster
Similar questions
- Create a new javascript file called cart.js and make a product object for each of your products and store it in a products array when the script loads. Create an empty array to store the items added to the cart. Program the "add to cart button" to take the product id, finds the product object in the products array and adds it to the items added to cart array. Program the "remove from cart button" to take the product id and remove the project object from the items purchased array. Existing code: <!DOCTYPE html><html> <head> <div id="product1" class="card"><img src="img/clorox.jpg"><h1>Clorox</h1><p class="price">$20.00</p><p>Household Cleaner</p><p><button id="product1Btn1">Add to Cart</button></p><p><button id="product1Btn2">Remove from Cart</button></p></div> <div id="product2" class="card"><img src="img/oxiclean.jpg"><h1>Oxiclean</h1><p…arrow_forwardFor each of the exercises below, assume you are starting with the following people array. and use javascript var people = ["Greg", "Mary", "Devon", "James"]; Using a loop, iterate through this array and write each element of the array people on the web document. Write the command to remove "Greg" from the array. Write the command to remove "James" from the array. Write the command to add "Matt" to the front of the array. Write the command to add your name to the end of the array. Write the command to make a copy of the array using slice. The copy should NOT include "Mary" or "Matt". Write the command that gives the indexOf where "Mary" is located. Write the command that gives the indexOf where "Foo" is located (this should return -1 as “Foo” not exist). Redefine the people variable with the value you started with. Using the splice command, remove "Devon" from the array and add "Elizabeth" and "Artie". Your array should look like this when you are done ["Greg", "Mary", "Elizabeth",…arrow_forwardWhat command would you run to remove the word indigo from the array colors? What command would you run to change orange to ORANGE in the array colors? What command would you run to display just the word green from the array colors?arrow_forward
- Objectives: Construct and use 1D and 2D arrays Send arrays to methods Iterate through an array to perform a calculation Details:This assignment will be completed using the Eclipse IDE. Attach your .java file to the Assignment page. Which of the following five people is the most interesting famous computer scientist? Grace Hopper Ada Lovelace Katherine Johnson Frances Allen Shafi Goldwasser Let’s say that we ask a group of 20 people to vote for which one of the computer scientists is most interesting. Each voter votes for one candidate and, of course, we are interested in who wins. Our data is a matrix with each row representing one of the five computer scientists and each column representing one of the 20 voters. The data in the matrix consists of 1s and 0s. The number 1 in each column represents a vote for the candidate represented by that row. Here is an example matrix (the data matrix is just the numbers). Next to each row is the name of the computer scientist represented by…arrow_forward61. Which of the following statements is true of field sets? Group of answer choices a. Field sets can contain a maximum of two fields. b. Field sets are created using the <area> tag. c. Field sets act like control elements, which are also called widgets. d. Field sets act like block elements that can expand to accommodate their content.arrow_forwardWhich of the following code elements is often removed at the end of a line? Why it is removed?arrow_forward
- Quiz (Select all that apply) Which of the following commands will store the HomeWins and AwayWins for Manchester City and Manchester United from EPL in a numeric array named mw? EPL Team Leicester City Arsenal 12 12 Manchester City 12 Manchester United 12 Newcastle United 7 6 5 U Norwich City Chelsea HomeWins Home Draws AwayWins AwayDraws mw = 6 4 2 5 7 5 9 11 8 7 7 2 3 7 6 7 7 4 3 2 5 EPL (3:4, [24]) mw = EPL {3:4, [24]} mw = EPL (3:4, ["HomeWins" "AwayWins"]) mw = EPL {3:4, ["HomeWins" "AwayWins"]} mw = [EPL. HomeWins(3:4) EPL.AwayWins(3:4)]arrow_forwardQ1. 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…arrow_forwardhelp finish the code of the provided code.arrow_forward
- My need help with this code. The code template pasted below.arrow_forwardFor each of the exercises below, assume you are starting with the following people array. and use javascript var people = ["Greg", "Mary", "Devon", "James"]; Write the command that gives the indexOf where "Mary" is located. Write the command that gives the indexOf where "Foo" is located (this should return -1 as “Foo” not exist). Redefine the people variable with the value you started with. Using the splice command, remove "Devon" from the array and add "Elizabeth" and "Artie". Your array should look like this when you are done ["Greg", "Mary", "Elizabeth", "Artie", "James"]. Create a new variable called withBob and set it equal to the people array concatenated with the string of "Bob". Display the elements in both ascendant and descendant orders.arrow_forwardWhich of the following is a correct declaration of a variable and a call to a constructor of an ArrayList of double precision (double) numbers? Assume that the default constructor is defined. ArrayList numbers = new ArrayList; O ArrayList numbers = new ArrayList(); %3D ArrayList numbers = new ArrayList(); ArrayList numbers = new ArrayList(); What is the UNIX command to copy the directory classes and its entire content that is located in your home directory into classes_bkp, also in your home directory? cp -r ~/classes ~/classes_bkp copydir -/classes ~/classes_bkp cp ~/classes ~/classes_bkp cp -r HOME/classes HOME/classes_bkparrow_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 Learning
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning