IT2808 Web Technologies Exams

Similar documents
Introduction to web development and JavaScript

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Chapter 1. Introduction to web development

Introduction to Web Technologies

WEB DEVELOPMENT IA & IB (893 & 894)

Web Development CSE2WD Final Examination June (a) Which organisation is primarily responsible for HTML, CSS and DOM standards?

Essential HTML & CSS for WordPress. Mark Raymond Luminys, Inc mraymond@luminys.com

CS134 Web Site Design & Development. Quiz1

Dreamweaver CS4 Day 2 Creating a Website using Div Tags, CSS, and Templates

Introduction to Web Development

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

Fast track to HTML & CSS 101 (Web Design)

CIS 467/602-01: Data Visualization

Cascading Style Sheets (CSS)

HTML and CSS. Elliot Davies. April 10th,

CST 150 Web Design I CSS Review - In-Class Lab

Chapter 7 Page Layout Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

Web Development I & II*

Microsoft Expression Web Quickstart Guide

Contents. Downloading the Data Files Centering Page Elements... 6

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

OPENTABLE GROUP SEARCH MODULE GETTING STARTED ADD RESERVATIONS TO YOUR WEBSITE

Base template development guide

{color:blue; font-size: 12px;}

Chapter 1 Introduction to web development and PHP

How To Create A Web Page On A Windows (For Free) With A Notepad) On A Macintosh (For A Freebie) Or Macintosh Web Browser (For Cheap) On Your Computer Or Macbook (

Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University

jquery Tutorial for Beginners: Nothing But the Goods

Web Design with CSS and CSS3. Dr. Jan Stelovsky

Basics of HTML (some repetition) Cascading Style Sheets (some repetition) Web Design

We automatically generate the HTML for this as seen below. Provide the above components for the teaser.txt file.

Interactive Data Visualization for the Web Scott Murray

Contents. Introduction Downloading the Data Files... 2

Responsive Web Design Creative License

10CS73:Web Programming

Web Design Certification

Creating Web Pages with HTML Simplified. 3rd Edition

Links Getting Started with Widgets, Gadgets and Mobile Apps

Selectors in Action LESSON 3

GUIDE TO CODE KILLER RESPONSIVE S

Further web design: Cascading Style Sheets Practical workbook

Web Authoring CSS. Module Descriptor

Style & Layout in the web: CSS and Bootstrap

Introduction to Web Design Curriculum Sample

CSS 101. CSS CODE The code in a style sheet is made up of rules of the following types

JJY s Joomla 1.5 Template Design Tutorial:

ITNP43: HTML Lecture 4

This document will describe how you can create your own, fully responsive. drag and drop template to use in the creator.

CSCI110: Examination information.

CSS. CSS - cascading style sheets CSS - permite separar num documento HTML o conteúdo do estilo. ADI css 1/28

CSS for Page Layout. Key Concepts

Short notes on webpage programming languages

Macromedia Dreamweaver 8 Developer Certification Examination Specification

Web Designing with UI Designing

WEB DESIGN COURSE CONTENT

Course: CSC 224 Internet Technology I (2 credits Compulsory)

Learning Web Design. Third Edition. A Beginner's Guide to (X)HTML, Style Sheets, and Web Graphics. Jennifer Niederst Robbins

SUBJECT CODE : 4074 PERIODS/WEEK : 4 PERIODS/ SEMESTER : 72 CREDIT : 4 TIME SCHEDULE UNIT TOPIC PERIODS 1. INTERNET FUNDAMENTALS & HTML Test 1

Using Style Sheets for Consistency

The Essential Guide to HTML Design

HTML5 and CSS3. new semantic elements advanced form support CSS3 features other HTML5 features

Google Web Toolkit. Progetto di Applicazioni Software a.a. 2011/12. Massimo Mecella

M3-R3: INTERNET AND WEB DESIGN

Kentico CMS, 2011 Kentico Software. Contents. Mobile Development using Kentico CMS 6 2 Exploring the Mobile Environment 1

Web layout guidelines for daughter sites of Scotland s Environment

SAULT COLLEGE OF APPLIED ARTS AND TECHNOLOGY SAULT STE. MARIE, ONTARIO COURSE OUTLINE

Mobile Web Site Style Guide

BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS COPYRIGHT 2013 TERRY ANN MORRIS, ED.D

Marketing 101 Maximizing Results

Welcome to CSE 330 Crea0ve Progamming and Rapid Prototyping. Course Informa0on

Mobile Web Design with HTML5, CSS3, JavaScript and JQuery Mobile Training BSP-2256 Length: 5 days Price: $ 2,895.00

ios App Development Using Cordova

The Essential Guide to HTML Design

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Web Design Specialist

About XML in InDesign

ICE: HTML, CSS, and Validation

WordPress and HTML Basics

SPLIT BLOCK FINAL Web Design

Outline of CSS: Cascading Style Sheets

Outline. CIW Web Design Specialist. Course Content

Web Building Blocks. Joseph Gilbert User Experience Web Developer University of Virginia Library

Differences between HTML and HTML 5

HTML CSS Basic Structure. HTML Structure [Source Code] CSS Structure [Cascading Styles] DIV or ID Tags and Classes. The BOX MODEL

Module 6 Web Page Concept and Design: Getting a Web Page Up and Running

Coding Standards for Web Development

HTML TIPS FOR DESIGNING

Dreamweaver CS5. Module 1: Website Development

CREATING A NEWSLETTER IN ADOBE DREAMWEAVER CS5 (step-by-step directions)

Web Design and Databases WD: Class 7: HTML and CSS Part 3

Responsive Web Design for Teachers. Exercise: Building a Responsive Page with the Fluid Grid Layout Feature

Oct 15, Internet : the vast collection of interconnected networks that all use the TCP/IP protocols

Lesson Review Answers

Transcription:

IT2808 Web Technologies Exams Section A: Multiple Choice Questions (30%) 1. In CSS, you can override precedence rules by adding the property to a style declaration. (2%) A.!override B.!main C.!important D.!priority 2. Given a For loop counter of for (var i = 1; i <= 5; i+=2), the counter values are. (2%) A. 1 and 3 B. 1, 3, and 5 C. 5, 3, and 1 D. 1, 2, 3, 4 and 5 3. Which of the following is not a legal JavaScript statement for accessing objects? (2%) A. document.images[1].src="exam.gif"; B. document.myform.mytextbox.value = myname ; C. document.getelementsbyid[ myid ].src="exam.gif"; D. document.p[1]="text for my first paragraph"; (This question will not be considered for the final score due to mistake) 4. Among the following types of style rules, has the highest priority. (2%) A. User Defined Rules B. External Style Rules C. Embedded Rules D. Inline Styles A and D can be right under different circumstances (eg.!important, CSS1 or 2), since these things were undefined both A and D will considered correct. 5. Which one of the following statements is false? (2%) A. In JavaScript, identifier names are case sensitive. B. JavaScript code can appear in both <head> and <body> sections. C. External JavaScript file can be linked using the <link> element. D. JavaScript can be turned off by the users concerning of security.

6. The style rule li, em {color: blue} indicates the content of will appear in blue color. (2%) A. Both <em> and <li> elements B. Any <em> elements that are inside a <li> element C. The first <em> element that is inside a <li> element D. The <li em> element 7. What is one advantage that HTML5 APIs offer for modern Web design? (2%) A. They enable users to view Flash content on mobile devices. B. They enable developers to create apps without coding skills C. They enable older browsers to display any multimedia content D. They enable users to view multimedia without plug-ins 8. Which protocol is ideal for transmitting large files? (2%) A. HTTP B. FTP C. SMTP D. RTP 9. Match each of the TCP/IP layers with the correct protocol. (8% -2% each) a) Application Layer 1) IP b) Transport Layer 2) WiFi c) Network Layer 3) TCP d) Physical Layer 4) HTTP a4, b3, c1, d2 10. Indicate whether each of the following statements is True or False, and explain your answer briefly (within a line). (6% - 2% each) A. HTML allows constructs that are not permitted in XHTML. Answer: TRUE. For example, you can omit close tags for many elements, or use characters such as < without escaping them. B. GIF supports 8-bit transparency, meaning image can fade-in through partial transparency.

Answer: WRONG, GIF supports either fully transparent or opaque C. Is this a "well formed" XML document? <?xml version="1.0"?> <note> <to age="29">tove</to> <from>jani</from> </note> Answer: TRUE. Checked by XML validator Well Formed XML Documents An XML document with correct syntax is "Well Formed". XML documents must have a root element XML elements must have a closing tag XML tags are case sensitive XML elements must be properly nested XML attribute values must be quoted Section B: Longer Answer Questions (40%) 1. How many alert dialogs will the following Javascript generate, and what will be displayed in each of them? (5%) var x = "10"; function f(){ var x = "4"; alert(this.x); function g(){alert(x);} g(); } f(); Answer: there will be 2 alert dialogs. The first will display 10, (or undefined, both are correct) and the second will display 4. 2. The following web page is loaded into a web server:

<html> <head><title>javascript question</title></head> <body> <script type="text/javascript"> book = new Array(1,2,3,4,5,6,7,8); document.write(book[1]); book[10]=10; document.write(book[10]); </script> </body> </html> Once the above web page is loaded what will be the outcome? (5%) 210 Because book[1] prints 2 and book[10] prints 10 3. Describe the situations of using External Style Sheets, Embedded (Internal) Style Sheets and Inline Styles. Use both CSS and HTML code to explain how to use each type of the styles. (10%) An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing just one file. <head> <link rel="stylesheet" type="text/css" href="mystyle.css" /> </head> An Embedded (Internal) style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, inside the <style> tag. <style type="text/css"> body { font-family: Helvetica, Arial, sans-serif; color: #665544; padding: 22px;} </style> Inline style is used to provide styling to a given element in a web page. An inline style loses many of the advantages of a style sheet (by mixing content with presentation). <body> <h1 style="color:blue;margin-left:30px;">this is a heading.</h1> </body

4. Identify and describe four properties that are used in the CSS box model (feel free to draw a figure if you want). (10%) Margin - Clears an area around the border. The margin does not have a background color, it is completely transparent Border - A border that goes around the padding and content. The border is inherited from the color property of the box Padding - Clears an area around the content. The padding is affected by the background color of the box Content - The content of the box, where text and images appear Image from w3schools.com 5. Explain the differences between POST and GET when sending HTML form data. (10%) GET Send data to the server by appending it to the end of the URL Sensitive data will be displayed as part of the URL URL has size restrictions not suitable for large amount of data Query can be cached for future use POST Send data as separate packets The data is hidden from user but still in plain text, but possible to work with https. Suitable for sending file and large amount of data for storage on the server-side Not possible for caching and bookmarking Section C: Coding (Snippets) Questions (40%) 1. Below you will see some snippets of HTML from a Web page. Fill in the body of the Javascript function changecolor so that the color of the text changes in response to the selection made in the menu (5%)

<style type="text/css">.a {color:red;}.b {color:green;}.c {color:blue;} </style>... <div id="colortext">select below to change the color of this text</div> <select onchange="changecolor(this.value)"> <option value="a">red</option> <option value="b">green</option> <option value="c">blue</option> </select> <script type="text/javascript"> //<![CDATA[ function changecolor(value) { } //]]> </script> // Answer: document.getelementbyid("colortext").classname = value 2. Consider the following HTML file: <!DOCTYPE html> <html> <head> <title> Test Page </title> </head> <body> <header ><h1> This is a test page </h1></header> <nav id="menu"> <ul>

</ul> </nav> <li><a href ="home.php">home </a/> </li> <li><a href ="login.php">login </a> </li> <li><a href ="register.php">register </a/> </li> <section id="main"> <article> <p>this is a line </p> This is another line with a <a href="link.html">link </a> </article> <article> <p> This is a line.</p> <p> This is another line.</p> </article> </section> </body> </html> Write the CSS rules needed to: See all the results working here: http://www.idi.ntnu.no/~michailg/it2805/examples/examsexample.html (a) Change the width of the menu to 400px. (3%) #menu { } width: 400px; (b) Make all links in the menu bold. (3%)

#menu a { font-weight: bold; } (c) Change the color of the link in the first article to green. (3%) #main a {color:green;} You can be even more specific here! (d) Turn the list into an inline element (3%) li {display: inline;} (e) Delete the Home line of the list (3%) li.first-child {display: none;} delete expression = not displayed, hence other explained interpretations are correct here. 3. Write a JavaScript function that calculates the number of days left till the Christmas Date (10%). <html> <body> <script type="text/javascript"> var dt = new Date(); // current date var xmas = new Date(2014,12,25); // this xmas var ms = xmas-dt; // calc ms from now to new year var days = ms/(1000*60*60*24); // convert ms to days days = Math.floor(days); // round down to nearest integer document.write("days to xmas = "+days); </script> </body> </html> 4. Convert the data in the table below to an XML document. Choose how you want to represent the data in XML. (10%) Country Capital Population Area (km²)

Country Capital Population Area (km²) Denmark Copenhagen 5 602 628 43 561 Finland Helsinki 5 426 674 338 534 Iceland Reykjavik 321 857 103 440 Norway Oslo 5 051 275 323 787 Sweden Stockholm 9 555 893 447 420 (Source: Wikipedia) <?xml version="1.0" encoding="utf-8"?> <countries> <country name="denmark" capital="copenhagen" population="5602628" area="43561" /> <country name="finland" capital="helsinki" population="5426674" area="338534" /> <country name="iceland" capital="reykjavik" population="321857" area="103440" /> <country name="norway" capital="oslo" population="5051275" area="323787" /> <country name="sweden" capital="stockholm" population="9555893" area="447420" /> </countries> or <?xml version="1.0" encoding="utf-8"?> <countries> <country> <name>denmark</name> <capital>copenhagen</capital> <population>5602628</population> <area>43561</area> </country> <country> <name>finland</name> <capital>helsinki</capital> <population>5426674</population> <area>338534</area> </country>

<country> <name>iceland</name> <capital>reykjavik</capital> <population>321857</population> <area>103440</area> </country> <country> <name>norway</name> <capital>oslo</capital> <population>5051275</population> <area>323787</area> </country> <country> <name>sweden</name> <capital>stockholm</capital> <population>9555893</population> <area>447420</area> </country> </countries>