tags to be executed by web browsers.","upvoteCount":1}},{"@context":"https://schema.org","@type":"Question","eduQuestionType":"Flashcard","text":"JavaScript is an event-based programming language .","acceptedAnswer":{"@type":"Answer","text":"JavaScript supports event-driven programming, allowing code to execute in response to events like user inputs, mouse clicks, or messages from other programs.","upvoteCount":1}},{"@context":"https://schema.org","@type":"Question","eduQuestionType":"Flashcard","text":"In programming, when two strings are compared, the comparison is not case sensitive .","acceptedAnswer":{"@type":"Answer","text":"By default, string comparison is case sensitive in most programming languages, meaning that \"Hello\" and \"hello\" would be considered different strings.","upvoteCount":1}},{"@context":"https://schema.org","@type":"Question","eduQuestionType":"Flashcard","text":"Creating the buttons that are needed on a form is called initialization .","acceptedAnswer":{"@type":"Answer","text":"Initialization refers to the process of setting up the initial state of an object or system, which might include creating buttons on a form, but it encompasses much more than just creating buttons. It involves preparing the entire form or application for use, which can include setting up data structures, default values, and other UI elements, not just buttons.","upvoteCount":1}},{"@context":"https://schema.org","@type":"Question","eduQuestionType":"Flashcard","text":"<script> . . . </script> tags are not needed for event handlers .","acceptedAnswer":{"@type":"Answer","text":"Event handlers can be added directly to HTML elements using attributes like onclick, onsubmit, etc., without the need for enclosing
The variables for The Bean Counter JavaScript program in the textbook are declared right before the opening <body> tag and inside <script> </script> tags .
Question
The <hr/> tag is used to display a horizontal line .
Question
The best way to develop a program is start writing code and modify it as needed .
Question
JavaScript code is entered between <script> . . . </script> tags .
Question
JavaScript is an event-based programming language .
Question
In programming, when two strings are compared, the comparison is not case sensitive .
Question
Creating the buttons that are needed on a form is called initialization .
Question
<script> . . . </script> tags are not needed for event handlers .
Question
A web page can only have one form .
Question
Event handlers are limited to a single JavaScript statement .
Question
A good application to build an HTML web page is
A) Google Docs B) Word C) AppleWorks D) Notepad++
Question
UI stands for
A) uniform interface B) user interface C) union interface D) uniform IP
Question
A grid of rows and columns can be created using which of the following tags?
A) <grid> . . . </grid> B) <column><row> . . . <row></column> C) <row><column> . . . </column></row> D) <div> . . . </div>
Question
In JavaScript output displayed in a popup box can be produced with the ________ command .
A) printout B) alert C) display D) lprint
Question
To keep an area of page that contains related content together on a web page, use the ________ tag pair .
A) <area> . . . </area> B) <section> . . . </section> C) <body> . . . </body> D) <grid> . . . </grid>
Question
To center a section of a web page within <section> . . . </section> tags, with CSS, use which of the following style definitions?
A) section {text-align: auto } B) section {margin-left: center; margin-right: center;} C) section {margin-left:auto; margin-right: auto; } D) section {margin: center;}
Question
The ________ performs a task that responds to an event .
A) error handler B) event handler C) input processor D) input handler
Question
When a button is clicked in a form
A) a click event is generated B) a dialog box is displayed C) the form closes D) the form is deleted
Question
An advantage of the <button> tag over <input type = "button"> is that
A) it allows some control over the displayed size B) only one input button is allowed on any HTML form C) it supports the onclick which input does not D) the <button> can contain any HTML, including an image
Question
Which tag is used to implement menu options?
A) <checkbox> . . . </checkbox> B) <select option> . . . </select option> C) <textbox> . . . </textbox> D) <select> . . . </select>
Question
A <select> tag surrounds a series of ________ tags and ends with a closing </select> tag .
A) <option> . . . </option> B) <radio> . . . </radio> C) <textbox> . . . </textbox> D) <checkbox> . . . </checkbox>
Question
Which of the following statements is TRUE, given: <button onclick = 'ounce = 8'> Small </button>
A) This is an error: <button> doesn't use a closing tag . B) The first equals sign is HTML, the second is JavaScript . C) This is an error: only one equals sign is allowed . D) This will set both onclick and ounce to 8 .
Question
Given the following statement, when will the event be generated? <button onclick = 'ounce = 8'> Small </button>
A) when the user clicks Small B) when the value of ounce is 8 C) when the value of ounce is Small D) When the user enters 8
Question
Which of the following is an advantage to using a strategy of breaking a programming task into small pieces and testing the program after each piece is created?
A) Errors are easily fixed because we know exactly where they are located . B) No task is overly complex . C) Errors are easily identified . D) All of these
Question
Which of the following would display result as 4 . 50, given the code below? Cost = 9 . 00; New_cost = cost/2
A) result = (Math . round(new_cost*100)/100) . toFixed(2); B) result = (Math . round(new_cost*100)/100); C) result = (Math . round(new_cost*100) . toFixed(2)); D) result = (Math . round(new_cost));
Question
What is the value of the variable shipping if cost = 50 and country = "Canada"? If (cost < 50 && country == "Canada") Shipping = 6 . 00; If (cost < 100 && cost > 49 && country == "Canada") Shipping = 9 . 00; Else Shipping = 12 . 00;
A) 12 . 00 B) 9 . 00 C) 6 . 00 D) cannot tell since the else clause does not specify the conditions
Question
Which of the following will produce a radio button with the name size and the label Medium?
A) <input type="pick" name="size" onclick=" . . . "/>"Medium"<br/> B) <input type="radio" name="pick" onclick="Medium"/><br/> C) <input type="radio" name="size" onclick=" . . . "/>Medium D) <input type="radio" name="size" onclick="Medium"/>
Question
Given the following styles in the <head> section of a web page, what would the page look like? <style type = "text/css"> Body {background-color: green; color: white;} H1 {text-align: center; color: blue;} P {color: red;} </style>
A) all text except h1 text and p text will be green B) green background with all text white except h1 text will be blue and centered and p text will be red and not centered C) green background, all text centered with blue h1 text and all other text red D) green background with all text white except h1 text will be blue and centered and p text will be red and centered
Question
Select all that apply . Which of the following are steps to take when building a web application?
A) revise the page and the programming logic to make improvements B) use event driven programming to create working form elements C) create a program to join the GUI to the UI D) build the interface
Question
Select all that apply . Which of the following are form input elements?
A) text box B) radio button C) check box D) form name
Question
The first step in programming is to create a(n) ________ .
Question
Buttons and checkboxes are ________ of forms .
Question
________ tags must surround all of the input elements .
Question
A(n) ________ is an indication from the computer that something just happened (for example, a mouse click) .
Question
A programming style that responds to things that happen, such as a mouse click or an entry into an input box, is known as ________ programming .
Question
In JavaScript, a(n) ________ attribute tells the browser how to respond to an event .
Question
Setting the initial values for the variables in a program is called ________ .
Question
The value ________ of an input element with type = "button"provides the label on the button .
Question
The type for an input element that can provide both the input and output of numeric or string values is ________ .
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/40
Play
Full screen (f)
Deck 18: A Javascript Program
1
JavaScript is designed for web applications .
True
2
The variables for The Bean Counter JavaScript program in the textbook are declared right before the opening <body> tag and inside <script> </script> tags .
False
3
The <hr/> tag is used to display a horizontal line .
True
4
The best way to develop a program is start writing code and modify it as needed .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
5
JavaScript code is entered between <script> . . . </script> tags .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
6
JavaScript is an event-based programming language .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
7
In programming, when two strings are compared, the comparison is not case sensitive .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
8
Creating the buttons that are needed on a form is called initialization .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
9
<script> . . . </script> tags are not needed for event handlers .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
10
A web page can only have one form .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
11
Event handlers are limited to a single JavaScript statement .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
12
A good application to build an HTML web page is
A) Google Docs B) Word C) AppleWorks D) Notepad++
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
13
UI stands for
A) uniform interface B) user interface C) union interface D) uniform IP
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
14
A grid of rows and columns can be created using which of the following tags?
A) <grid> . . . </grid> B) <column><row> . . . <row></column> C) <row><column> . . . </column></row> D) <div> . . . </div>
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
15
In JavaScript output displayed in a popup box can be produced with the ________ command .
A) printout B) alert C) display D) lprint
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
16
To keep an area of page that contains related content together on a web page, use the ________ tag pair .
A) <area> . . . </area> B) <section> . . . </section> C) <body> . . . </body> D) <grid> . . . </grid>
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
17
To center a section of a web page within <section> . . . </section> tags, with CSS, use which of the following style definitions?
A) section {text-align: auto } B) section {margin-left: center; margin-right: center;} C) section {margin-left:auto; margin-right: auto; } D) section {margin: center;}
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
18
The ________ performs a task that responds to an event .
A) error handler B) event handler C) input processor D) input handler
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
19
When a button is clicked in a form
A) a click event is generated B) a dialog box is displayed C) the form closes D) the form is deleted
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
20
An advantage of the <button> tag over <input type = "button"> is that
A) it allows some control over the displayed size B) only one input button is allowed on any HTML form C) it supports the onclick which input does not D) the <button> can contain any HTML, including an image
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
21
Which tag is used to implement menu options?
A) <checkbox> . . . </checkbox> B) <select option> . . . </select option> C) <textbox> . . . </textbox> D) <select> . . . </select>
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
22
A <select> tag surrounds a series of ________ tags and ends with a closing </select> tag .
A) <option> . . . </option> B) <radio> . . . </radio> C) <textbox> . . . </textbox> D) <checkbox> . . . </checkbox>
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following statements is TRUE, given: <button onclick = 'ounce = 8'> Small </button>
A) This is an error: <button> doesn't use a closing tag . B) The first equals sign is HTML, the second is JavaScript . C) This is an error: only one equals sign is allowed . D) This will set both onclick and ounce to 8 .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
24
Given the following statement, when will the event be generated? <button onclick = 'ounce = 8'> Small </button>
A) when the user clicks Small B) when the value of ounce is 8 C) when the value of ounce is Small D) When the user enters 8
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
25
Which of the following is an advantage to using a strategy of breaking a programming task into small pieces and testing the program after each piece is created?
A) Errors are easily fixed because we know exactly where they are located . B) No task is overly complex . C) Errors are easily identified . D) All of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
26
Which of the following would display result as 4 . 50, given the code below? Cost = 9 . 00; New_cost = cost/2
A) result = (Math . round(new_cost*100)/100) . toFixed(2); B) result = (Math . round(new_cost*100)/100); C) result = (Math . round(new_cost*100) . toFixed(2)); D) result = (Math . round(new_cost));
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
27
What is the value of the variable shipping if cost = 50 and country = "Canada"? If (cost < 50 && country == "Canada") Shipping = 6 . 00; If (cost < 100 && cost > 49 && country == "Canada") Shipping = 9 . 00; Else Shipping = 12 . 00;
A) 12 . 00 B) 9 . 00 C) 6 . 00 D) cannot tell since the else clause does not specify the conditions
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
28
Which of the following will produce a radio button with the name size and the label Medium?
A) <input type="pick" name="size" onclick=" . . . "/>"Medium"<br/> B) <input type="radio" name="pick" onclick="Medium"/><br/> C) <input type="radio" name="size" onclick=" . . . "/>Medium D) <input type="radio" name="size" onclick="Medium"/>
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
29
Given the following styles in the <head> section of a web page, what would the page look like? <style type = "text/css"> Body {background-color: green; color: white;} H1 {text-align: center; color: blue;} P {color: red;} </style>
A) all text except h1 text and p text will be green B) green background with all text white except h1 text will be blue and centered and p text will be red and not centered C) green background, all text centered with blue h1 text and all other text red D) green background with all text white except h1 text will be blue and centered and p text will be red and centered
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
30
Select all that apply . Which of the following are steps to take when building a web application?
A) revise the page and the programming logic to make improvements B) use event driven programming to create working form elements C) create a program to join the GUI to the UI D) build the interface
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
31
Select all that apply . Which of the following are form input elements?
A) text box B) radio button C) check box D) form name
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
32
The first step in programming is to create a(n) ________ .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
33
Buttons and checkboxes are ________ of forms .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
34
________ tags must surround all of the input elements .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
35
A(n) ________ is an indication from the computer that something just happened (for example, a mouse click) .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
36
A programming style that responds to things that happen, such as a mouse click or an entry into an input box, is known as ________ programming .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
37
In JavaScript, a(n) ________ attribute tells the browser how to respond to an event .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
38
Setting the initial values for the variables in a program is called ________ .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
39
The value ________ of an input element with type = "button"provides the label on the button .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
40
The type for an input element that can provide both the input and output of numeric or string values is ________ .
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
Unlock Deck
Unlock for access to all 40 flashcards in this deck.