






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A web page for a popcorn sales form. The page includes a form with input fields for the buyer's name, address, and the quantities of different types of popcorn they would like to order. The form also includes radio buttons for the payment method. The xhtml code for the web page, as well as css and javascript functions to style the page and validate the input. This document could be useful for students studying web development, e-commerce, or form design, as it covers topics such as html form elements, css styling, and javascript validation.
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!







First Name ______________ Last Name_______________ ID ________________
Signature
Information:
**1. This is a close book exam.
//below is a JavaScript statement ‘$’ + (4+5)
B. h1.all {background-color:#FFFFFF} C. h1 {background-color:#FFFFFF} D.. h1 {background-color:#FFFFFF} Answer: C
This is a paragraph
B.This is a paragraph
C.This is a paragraph D.
This is nested
Answer: AC. NaN D. undefined E. error Answer: A
**
This is level 2 heading. **
Answer: C
Section II: Short Answer Questions (20 points)
A. test(“2”, “3”,”4”) returns ____________ B. test(2, 3, 4) returns C. test(“2”, 3, ”4”) returns
D. test(3, “a”, 4) returns ______
E. test(false, true, false) returns
answer:
A. test(“2”, “3”,”4”) returns ____false________ B. test(2, 3, 4) returns true C. test(“2”, 3, ”4”) returns false D. test(3, “a”, 4) returns false
E. test(false, true, false) returns true
test(a, b, c){ return a + bc == bc+a; }**
var sum = 0; function add_t() { var sum = sum + 20; }
add_t(); sum = sum + 1;
Section III: Answer the Following Questions with Code (30 points)
The box at the right shows a Web page to receive the orders for popcorn.
< > Popcorn Sales Form </ >
< > Welcome to Millenium GynmasticsBooster Club Popcorn Sales
type = " " name =
Street Address: <
type = " " name = "street" size = "30" />
City, State, Zip: <
type = " " name = "city" size = "30" />
Product Name Price Quantity
Unpopped Popcorn (1 lb.) $3.00 <
type = " " name = "unpop" size ="2" />
Caramel Popcorn (2 lb. cannister) $3.50 <
type = " " name = "caramel" size = "2" />
Caramel Nut Popcorn (2 lb. cannister) $4.50 <
type = " " name = "caramelnut" size = "2" />
Toffey Nut Popcorn (2 lb. cannister) $5.00 <
type = " " name = "toffeynut" size = "2" />
Payment Method:< type = " " name = "payment"
value = "visa" checked = "checked" /> Visa
< type = " " name = " "
value = "mc" /> Master Card
< type = " " name = " "
value = "discover" /> Discover
< type = " " name = "payment" value = "check" /> Check
< <
</ >
Answer:
type = " " value = "Submit Order" /> type = " " value = "Clear Order Form" />
Caramel Popcorn (2 lb. cannister) $3.50
Caramel Nut Popcorn (2 lb. cannister) $4.50
Toffey Nut Popcorn (2 lb. cannister) $5.00
Payment Method:
Visa
Master Card
Discover
Check
inline style.
a) Change the background color of the whole page to green.
Answer: body {background-color: green}
b) All the headings (H1-H6) of this page should be displayed in italic, bold, and Arial font.
Answer:
h1, h2, h3, h4, h5, h6 {font-style: italic; font-family: Arial; font-weight: bold}
c) Style the table to take 50% of the browser window.
Answer: #order {width: 50%};
You do not need to program how the two functions are called.
Answer:
// popcorn_validatorr.js
// Produce an alert message about the chosen payment
function paymentChoice (value) {
switch (value) { case "visa": alert("you have chosen Visa"); break; case "mc": alert("you have chosen Master Card"); break; case "discover": alert("you have chosen Discovery Card "); break; case "check": alert("you have chosen Check"); break;