PIC 40A. Midterm 1 Review

Similar documents
Introduction to WEB PROGRAMMING

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

CSS: Cascading Style Sheets

CIS 228 (Spring, 2012) Final, 5/17/12

HTML and CSS COURSE SYLLABUS

Deccansoft Software Services

Lab Introduction to Cascading Style Sheets

Assignments (4) Assessment as per Schedule (2)

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

First Name Last Name CS-081 March 23, 2010 Midterm Exam

NAVIGATION INSTRUCTIONS

Web Site Development with HTML/JavaScrip

HTML & CSS. Lesson 1: HTML Basics Lesson 2: Adding Tables Lesson 3: Intro to CSS Lesson 4: CSS in more detail Lesson 5: Review

VTU Question Bank. UNIT 1 Introduction to WWW, XHTML

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from

Positioning in CSS: There are 5 different ways we can set our position:

CSS: formatting webpages

Mobile Site Development

12/9/2012. CSS Layout

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

PIC 40A. Lecture 4b: New elements in HTML5. Copyright 2011 Jukka Virtanen UCLA 1 04/09/14

Block & Inline Elements

Cascading style sheets, HTML, DOM and Javascript

COMP1000 Mid-Session Test 2017s1

CIS 228 (Fall, 2012) Exam 2, 11/20/12

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

USER GUIDE MADCAP FLARE Tables

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

Lab 8 CSE 3,Fall 2017

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

Static Webpage Development

Three Ways to Use CSS:

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Final Exam Study Guide

CSS: Cascading Style Sheets

Cascading Style Sheet. Styles as Tag Attributes. Syntax. <h1>: what font type/size is used? STYLE = SELECTOR {RULES} Attributes such as bgcolor

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

To Ponder. Which one wins? .draft div.warning li { }.draft div #main li {!important; } div #main ul li { }.draft.warning ul li { }

MODULE 2 HTML 5 FUNDAMENTALS. HyperText. > Douglas Engelbart ( )

CS197WP. Intro to Web Programming. Nicolas Scarrci - February 13, 2017

Best Practices Chapter 5

LING 408/508: Computational Techniques for Linguists. Lecture 14

Comp 426 Midterm Fall 2013

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

CSS.

Lesson 1: Writing Your First JavaScript

INTRODUCTION TO JAVASCRIPT

To place an element at a specific position on a page use:

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

CISC 1600 Lecture 2.4 Introduction to JavaScript

Proper_Name Final Exam December 21, 2005 CS-081/Vickery Page 1 of 4

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

CSC309 Winter Lecture 2. Larry Zhang

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below)

Using Dreamweaver CS6

Chapter 4 Creating Tables in a Web Site Using an External Style Sheet

YouTube Break.

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

JS Lab 1: (Due Thurs, April 27)

LAST WEEK ON IO LAB. Install Firebug and Greasemonkey. Complete the online skills assessment. Join the mailing list.

ICT IGCSE Practical Revision Presentation Web Authoring

Data Visualization (DSC 530/CIS )

CSC 121 Computers and Scientific Thinking

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

CSS. Selectors & Measurments. Copyright DevelopIntelligence LLC

LA TROBE UNIVERSITY SEMESTER ONE EXAMINATION PERIOD CAMPUS AW BE BU MI SH ALLOWABLE MATERIALS

Web Development IB PRECISION EXAMS

CMPT 165 Advanced XHTML & CSS Part 3

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations

What is the Box Model?

CSS Cont'd: Cascading Style Sheets

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

Web Programming Pre-01A Web Programming Technologies. Aryo Pinandito, ST, M.MT

Setting Up a Development Server What Is a WAMP, MAMP, or LAMP? Installing a WAMP on Windows Testing the InstallationAlternative WAMPs Installing a

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU

Web Development. With PHP. Web Development With PHP

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

Cascading Style Sheets (CSS)

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

Data Visualization (CIS/DSC 468)

CSS: The Basics CISC 282 September 20, 2014

Before you begin, make sure you have the images for these exercises saved in the location where you intend to create the Nuklear Family Website.

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

HTML and CSS a further introduction

CSE 154: Web Programming Autumn 2018

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

XHTML & CSS CASCADING STYLE SHEETS

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

UNIVERSITY OF TORONTO SCARBOROUGH WINTER 2016 EXAMINATIONS. CSC B20H3 Duration 3 hours. No Aids Allowed

Transcription:

PIC 40A Midterm 1 Review

XHTML and HTML5 Know the structure of an XHTML/HTML5 document (head, body) and what goes in each section. Understand meta tags and be able to give an example of a meta tags. Know the rules concerning tags, attributes and element nesting, placement of elements and general syntax.

In previous midterms I have given an screenshot of a web page or part of a webpage and asked the students to write the necessary XHTML that would render like the screenshot.

<table summary="some random numbers" border="border"> <caption>my Nums Rowspan</caption> <tr> <th>1</th> <td>2</td> </tr> <tr> <td>3</td> <td rowspan="2">5</td> </tr> <tr> <td>4</td> </tr> </table> <table summary="some more random numbers" border="border"> <caption>more Nums Colspan</caption> <tr> <td>7</td> <td>8</td> </tr> <tr> <th colspan="2">9</th> </tr> <tr> <td>10</td> <td>11</td> </tr> </table>

XHTML problem, if it is lengthy, may appear as its own problem. You may be asked to write short snippets of XHTML code in the short answer question section. Typically short answer question consists of 3-4 parts. Each part you are asked to accomplish some minor task using 1-5 lines of code. In addition XHTML may show up in conjunction with other questions such as CSS or JS. You may be asked to write some XHTML and then style it using CSS.

What to expect Examples of short answer XHTML/HTML5 questions: Question 1. a) Fall 2012 Example of longer XHTML question: Question 1. Winter 2012

CSS You should know why it is important to separate structure from style and be able to describe how CSS accomplishes this. Know CSS syntax and how to apply CSS to an XHTML document either by internal style or external stylesheet Understand selector rules Know how basic conflict between rules is resolved Understand the inheritance examples Box model Understand the big website example Understand CSS menus (HW #2, Example in class) You do not need to memorize all CSS properties and their corresponding values, but you should be able to know how to use a property if I give it to you.

a) Write a CSS code that specifies that all <span> elements nested inside a <p> element should be in bold and color blue. Hint: You may find the property font-weight useful. p span { color: blue; font-weight:bold;} b) Create a <p> element that belongs to a class red then write CSS code to style all elements in the red class to have red font color. <p class="red">mmmm...red...</p>.red {color: red;}

Assume we have the following XHTML: <div id="image_container"> <img id="image1" src="pic1.gif" alt="pic1" /> <img id="image2" src="pic2.gif" alt="pic2" /> </div> a) Write the necessary style instructions to position the two images on top of each other so that initially image1 is on top of image 2.

Solution: #image1 { position:absolute; left: 0; top: 0; z-index:1; } #image2 { position:absolute; left: 0; top: 0; z-index:-1; }

<div id="image_container"> <img id="image1" src="pic1.gif" alt="pic1" /> <img id="image2" src="pic2.gif" alt="pic2" /> </div> b) Write the necessary style instructions so that as the mouse cursor is moved over the div, image2 becomes the top image.

Solution: #image_container:hover img1{z-index:-2;}

3. [10pts.] Write the necessary CSS style instructions so that the XHTML code snippet below is rendered as the picture below shows. The container should have width 200px and the two boxes should have dimensions 50px by 50px. In addition when the mouse is moved over the box with the word "RED" the background of that box should turn red and when the mouse is moved over the box with the word "BLUE" the background of that box should turn blue. <div id="container"> <div class="red_box">red</div> <div class="blue_box">blue</div> </div>

Solution: <head>... <style type="text/css"> #container{width: 200px;} div.blue_box{width:50px; height:50px; border: 1px solid; float:right;} div.blue_box:hover{background-color:blue;} div.red_box{width:50px; height:50px; border: 1px solid; float: left;} div.red_box:hover{background-color:red;} </style> </head>

JavaScript may show up in few ways: A true or false question about a single line of code of JS A short answer question Debugging a given JS program Writing a JS program to solve a given problem

Basic JS You should know basic JS that we discussed in the first two JS lectures. Where to place JS and how. What do different placements mean? What is the point of script hiding? JS statements Rules concerning identifiers You should know data types. Number,String,Boolean,Undefined, Null Know how to declare variables. JS is dynamically typed! Many concepts carry over from C++ such as basic operations You should understand type convertions, both coercions and explicit casts. You should know how to concatenate.

JS Wrapper objects, input output, control structures, random numbers Wrapper objects You should know the string properties and methods You do not have to know the Number objects wrapper properties or methods Predefined objects Math object Date object Input output document.write alert confirm prompt Control structures Random numbers

JS functions You should know how to call a function You should know the basic syntax You should know the facts about functions (pass by value etc. ) Local vs Global variables JS Events onclick attribute for buttons settimeout setinterval

JS arrays The different ways of declaring an array Array methods and properties

Old exam questions 5. [20pts, a) 5pts, b) 5pts, c) 10pts] JavaScript This problem will guide you through creating a JS program that accomplishes the following task. The user is prompted to enter numbers until he hits cancel. Then, a histogram of these numbers is printed to the browser. For example, if the user inputs the numbers 5 7 4 2 The browser should output the following picture: * * * * * * * * * * * * * * * * * * a) Keep prompting the user for a number and place the number in an array called numbers until the user hits cancel.

Old exam questions 5. [20pts, a) 5pts, b) 5pts, c) 10pts] JavaScript This problem will guide you through creating a JS program that accomplishes the following task. The user is prompted to enter numbers until he hits cancel. Then, a histogram of these numbers is printed to the browser. For example, if the user inputs the numbers 5 7 4 2 The browser should output the following picture: * * * * * * * * * * * * * * * * * * a) Keep prompting the user for a number and place the number in an array called numbers until the user hits cancel.

Old exam question b) Write a function called max that takes as an argument an array of numbers and returns the max value in the array. Hints: Arrays have a property called length that gives the length of the array. max function will be useful in part c).

Old exam question c) Write the function called histogram that takes as an input an array of numbers and then outputs the histogram as in the example above. Hints: To print the histogram you must print an entire row at a time. To space out the columns use the character entity for space, Two spaces suffice to create the space between the columns. You must determine for each column if you need to print a * or not. If you do not need to print a *, then print an instead. One way to write the function is to use nested for loops, with the outer one controlling the number of rows and the inner one outputting each row.

JS question a) Write a JavaScript function called text_to_array that prompts the user to enter some phrase, and after that, each word in the phrase is stored in an array called words. Each slot of the array contains one word. (Do not worry about punctuation.) Hint: use the split method to split the text by " ". b) Write a JavaScript function called reverse_sort that takes as an argument the array words and sorts it in reverse lexicographical order. c) Write a JavaScript function called output that takes as argument the array words and writes its content using document.write. The content of each slot should be on a line of its own. Hint: Recall that arrays have a property called length that gives the last index-1 of the array.

JS DOM There will likely be a question on the DOM. Refer to: #4 Fall 2014 #4 Winter 2012