Chapter 2. Self-test exercises

Similar documents
Title: Jan 29 11:03 AM (1 of 23) Note that I have now added color and some alignment to the middle and to the right on this example.

What You Will Learn Today

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 1

HTMLnotesS15.notebook. January 25, 2015

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

How the Internet Works

CSC 121 Computers and Scientific Thinking

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

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

MPT Web Design. Week 1: Introduction to HTML and Web Design

Web Programming Week 2 Semester Byron Fisher 2018

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

A Balanced Introduction to Computer Science, 3/E

Creating Web Pages Using HTML

CHAPTER 1: GETTING STARTED WITH HTML CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

CSC Web Programming. Introduction to HTML

1 Creating a simple HTML page

Web Publishing Basics I

Assignments (4) Assessment as per Schedule (2)

HTML. Hypertext Markup Language. Code used to create web pages

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

Lab Introduction to Cascading Style Sheets

Introduction to Web Technologies

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

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

Hyper Text Markup Language HTML: A Tutorial

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

Introduction to HTML. SSE 3200 Web-based Services. Michigan Technological University Nilufer Onder

HTML and CSS: An Introduction

Web Designing HTML5 NOTES

Introduction to WEB PROGRAMMING

UNIX and Operating System Topics

Web Page Creation Part I. CS27101 Introduction to Web Interface Design Prof. Angela Guercio

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

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

CSC Web Technologies, Spring HTML Review

1.264 Lecture 12. HTML Introduction to FrontPage

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

HTML Tags <A></A> <A HREF=" CNN </A> HREF

Exercises. Task 1 Use My Computer to create a folder for the website. Step 1

Web Development and HTML. Shan-Hung Wu CS, NTHU

HTML and CSS COURSE SYLLABUS

Creating Web Pages. Getting Started

Lab 1: Introducing HTML5 and CSS3

ICT IGCSE Practical Revision Presentation Web Authoring

week8 Tommy MacWilliam week8 October 31, 2011

LAB 3 CSE 3, Spring 2018 In this lab you will learn and implement some basic html.

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

HTML & XHTML Tag Quick Reference

HTML. HTML Evolution

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

Introduction to using HTML to design webpages

In the early days of the Web, designers just had the original 91 HTML tags to work with.

Desire2Learn: HTML Basics

Beginning HTML. A tag is a command written between angle brackets (the less than and greater than symbols). Ex. <html>

Static Webpage Development

Basic HTML Handout & Exercise Web Technology

This document provides a concise, introductory lesson in HTML formatting.

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

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

Agenda. INTRODUCTION TO WEB DEVELOPMENT AND HTML <Lecture 1> 1/20/2013. What is a Web Developer? Rommel Anthony Palomino Spring

c122jan2714.notebook January 27, 2014

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

HTML & CSS. Rupayan Neogy

Tutorial 1: HTML Tutorial (Windows Version) HTML (Hypertext Markup Language) Basics Objectives

CS134 Web Site Design & Development. Quiz1

CS144 Notes: Web Standards

A Brief Introduction to HTML

The Internet & The World Wide Web

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

CSE 3. Marking Up with HTML. Comics Updates Shortcut(s)/Tip(s) of the Day Google Earth/Google Maps ssh Anti-Spyware

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

Html basics Course Outline

HTML Images - The <img> Tag and the Src Attribute

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Web Design 101. What is HTML? HTML Tags. Web Browsers. <!DOCTYPE html> <html> <body> <h1>my First Heading</h1> <p>my first paragraph.

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Website Development with HTML5, CSS and Bootstrap

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

CREATING WEBSITES. What you need to build a website Part One The Basics. Chas Large. Welcome one and all

COMP519 Web Programming Lecture 6: Cascading Style Sheets: Part 2 Handouts

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

Lab 4 CSS CISC1600, Spring 2012

Chapter 4 A Hypertext Markup Language Primer

SEEM4570 System Design and Implementation. Lecture 1 Cordova + HTML + CSS

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

Introduction to Computers and Their Applications

COMM 2555 Interactive Digital Communication LAB 4

Introduction to web development and HTML MGMT 230 LAB

Revision for Grade 7 ASP in Unit :1&2 Design & Technology Subject

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

COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

CSS BASICS. selector { property: value; }

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Web and Apps 1) HTML - CSS

Document Object Model. Overview

Final Exam Study Guide

University of Hawaii at Hilo WEB AND HTML THE INTERNET MAP ( COURTESY OF WIKIMEDIA COMMONS)

This will be a paragraph about me. It might include my hobbies, where I grew up, etc.

Introduction to HTML

Transcription:

Chapter 2 Self-test exercises ST1. Who invented the World Wide Web? Answer: Tim Berners-Lee ST2. What does the acronym http stand for? Answer: HyperText Transfer Protocol ST3. What does the acronym ftp stand for? Answer: File Transfer Protocol ST4. What does the acronym scp stand for? Answer: Secure Copy Protocol ST5. What are HTML5 tags? Answer: HTML5 tags are enclosed in a pair of angled brackets <...> and are instructions to the web browsers on the display and behavior of a web page. ST6. List four HTML5 tags. Answer: <head>...</head> <body>...</body> <!DOCTYPE> <title>...</title> <html>...</html> ST7. What is the purpose of comments in an HTML5 document? What is the syntax for a comment? Answer: Comments are used as documentation, so other developers can understand the HTML5 code in the web page. Comments are ignored by the web browser when displaying the web page and are not rendered on the page. A comment is enclosed in <!-- and -->. ST8. Which tag is used to create a table in an HTML5 document? Answer: <table>...</table> ST9. Which tag is used to create an unordered list in an HTML5 document? Answer: <ul>...</ul> ST10. Which tag is used to create an ordered list in an HTML5 document? Answer: <ol>...</ol> 2-1

ST11. Which tag is used to create a list item in an HTML5 document? Answer: <li>...</li> ST12. What is the difference between an ordered and unordered list in an HTML5 document? Answer: Labels in an ordered list follow a numeric or alphabetical order, such as 1, 2, 3,... or a, b, c. The unordered list is labeled with symbols such as bullets. ST13. What does the acronym CSS stand for? Answer: Cascading Style Sheet ST14. What is a stylesheet? Answer: HTML5 defines the structure of a web page. A stylesheet specifies how the elements of a web page should be displayed. ST15. Which tag is used to include an image in an HTML5 document? Answer: <img> ST16. Which tag is used to include a video in an HTML5 document? Answer: <video> </video> and <source> 2-2

Programming exercises PE1. Create a web page that looks like: Get an account from your system administrator and upload your web page to your account. Answer: <!DOCTYPE html> <html> <head> <title>first HTML5 document</title> </head> <body> <h1>first HTML5 document</h1> <h3>available on the web</h3> <p> I am reading this book to learn how to develop websites that can be accessed from any device and can serve as cross-platform apps. <br> The devices I will test will be running the following operating systems: <br><br> Apple ios <br> Google Android <br> Blackberry OS <br> Microsoft Windows Phone OS </p> 2-3

</body> </html> You will need a username and password from the system administrator. You will need to find the name of the folder where you are supposed to copy the web pages so that they can be viewed on the World Wide Web. You need a program such as WinSCP to upload the web page. Finally, you need to set the permissions of the web pages, so the web server can access them. PE2. View your web page from as many devices and web browsers as possible. Answer: You can either test them on physical devices, or download and install the emulators as described in Chapter 2 PE3. Write HTML5 code that will create the following display: Answer: <ol> </ol> <li> Apple ios </li> <li> Google Android </li> <li> Blackberry OS </li> <li> Microsoft Windows Phone OS </li> 2-4

PE4. Write HTML5 code that will create the following display: (Hint: You can nest an <ul>...</ul> pair of tags inside a pair of <li>...</li>) Answer: <ol> <li> Apple ios <ul> <li>ipad</li> <li>iphone</li> <li>ipod touch</li> </ul> </li> <li> Google Android <ul> <li>nexus 7</li> <li>samsung Galaxy Notes 8</li> <li>samsung Galaxy Notes 4</li> <li>hp Slate 7</li> </ul> </li> <li> Blackberry OS <ul> <li>blackberry Z10</li> <li>blackberry Q10</li> </ul> </li> <li> Microsoft Windows Phone OS/RT <ul> <li>nokia</li> <li>samsung ATIV</li> 2-5

<li>surface</li> </ul> </li> </ol> PE5. Write HTML5 code that will create the following display: Answer: <table border="1"> <tr> <td>apple ios</td> <td>ipad</td> <td>iphone</td> <td>ipod touch</td> <td> </td> </tr> <tr> <td>google Android</td> <td>nexus 7</td> <td>samsung Galaxy Notes 8</td> <td>samsung Galaxy Notes 4</td> <td>hp Slate 7</td> </tr> <tr> <td>blackberry OS</td> <td>blackberry Z10</td> <td>blackberry Q10</td> <td> </td> <td> </td> </tr> <tr> <td>microsoft Windows Phone OS/RT</td> <td>nokia</td> <td>samsung ATIV</td> <td>surface</td> <td> </td> </tr> </table> 2-6

PE6. Write the CSS3 and HTML5 that will create the following display: Answer: HTML5: <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="devices0.css"> </head> <body> <h1>programming exercises</h1> <p>devices</p> </body> </html> CSS3: h1, p { text-align: center; } PE7. Write the CSS3 for the web page from the previous exercise web page that will create the following display: Answer: HTML5: Same as PE7 CSS3: h1, p { text-align: center; color: white; } body { background-color: black; } 2-7

PE8. Write the CSS3 for your answer to PE5 that will create the following display: Answer: body { background-color: black; } table { background-color: gold; border-radius: 5px; border-collapse: collapse; } table td { border: 1px solid black; padding: 5px; } 2-8

Programming projects PRJ1. Compute the load distribution on a beam. Assume that you have a one-dimensional beam resting on two rigid supports. The beam has a length described by the variable length. We have put a weight w at a distance d, where d < length, from the left end of the beam. You should find out the reaction forces on the left and right ends of the beam. You can make this project as complicated as you are capable of solving. You can have multiple weights, uniformly distributed load, and uniformly varying loads. Use tables, ordered and unordered lists, other relevant tags such as <mark>, <em>, <sup>, and CSS3 to improve the appearance of the web page. Hint: PRJ2. You can search for the term "load distribution on beams" on the web. You will find many relevant websites. Binary operator. Create a web page that describes various binary operators such as "and", "or", "not", "xor". Use tables, ordered and unordered lists, other relevant tags such as <mark>, <em>, <sup>, and CSS3 to improve the appearance of the web page. Hint: PRJ3. You can search for the term "binary operators" on the web. You will find many relevant websites that will help you create content for your web page. Electricity calculations: Create a web page that describes the physical relationship between current, voltage, resistance, and amount of electricity consumed. Use tables, ordered and unordered lists, other relevant tags such as <mark>, <em>, <sup>, and CSS3 to improve the appearance of the web page. Hint: PRJ4. You can search for the term "current voltage resistance electricity consumption" on the web. You will find many relevant websites. Amortization calculations: Create a web page that describes how to compute the annual cost of a project that costs p and is funded by a loan at an interest i over y number of years. 2-9

Use tables, ordered and unordered lists, other relevant tags such as <mark>, <em>, <sup>, and CSS3 to improve the appearance of the web page. Hint: You can search for the term "amortization calculations" on the web. You will find many relevant websites. 2-10

Chapter 2 Developing, installing, and testing first app 1

Learning objectives 1. How to create a simple HTML5-based app 2. How to put the app on the web for general access through the web 3. How to enhance the presentation with CSS3 4. How to add multimedia to the web page including images and videos 2

Choice of programming platform The three major operating systems for mobile devices 1. ios by Apple 2. Windows 8 by Microsoft 3. Android by Google Apple devices: apps written in an integrated development environment (IDE) called Xcode. Windows mobile devices: apps written in.net framework. Cross-platform development well-established HTML HyperText Markup Language. a response to the changing nature of the Internet. 3

How to create a simple HTML5 web page Tags: instructions to the web browser regarding the display and behavior of a web page. An HTML5 tag is enclosed in two angled braces <...>. 4

How to create a simple HTML5 web page (cont d) A screenshot of the complete page 5

How to create a simple HTML5 web page (cont d) The rest of the HTML5 code that goes into the <body> section 6

How to create a simple HTML5 web page (cont d) The browsers uses physical line breaks based on the HTML5 tags. Other line breaks: come from two tags, <p>...</p> and <br>. One of the best resources which provides a comprehensive introduction to HTML5: http://www.w3schools.com 7

How to put an HTML5 web page on the Internet Directory called web. Example: ch02/physicsprojectileapp0/version1 look for a file called physicsprojectileapp.html Assume Windows as the default operating system for the rest of the discussion. Putting the app code on the web is the easiest way to download and distribute it to multiple mobile devices through wireless communication. Contact an Internet Service Provider (ISP) 8

How to put an HTML5 web page on the Internet (cont d) An account on a server with the domain name called cs.smu.ca. The domain name is translated into an IP address. An IP address is used to refer to any computer on the Internet. Web server: typically an Internet-accessible computer that is specially configured to serve and receive documents at very high rates of transmission. Apache Microsoft Exchange Server 9

Example Put our first HTML5 web page on the web for accessing it from any web-enabled device. Linux server Put our web pages in a folder called public_html. They will be accessible to the rest of the Internet using the URL: http://cs.smu.ca/~mobilebook. Transfer files from personal computer to the web server cs.smu.ca. WinSCP 10

Screenshot of the login screen for WinSCP to upload the web pages 11

Example (cont d) Permissions in the UNIX environment Linux and Mac OS X Users: owner, group, world The web server program: considered to be a user on the computer system and usually a part of the set of users called world or others. Three types of permissions: read (R), write (W), and execute/run (X). Reading, writing, and executing 12

Screenshot of the WinSCP after logging in 13

Example (cont d) Permission settings All the files under the folder public_html and recursively all its subfolders need to be readable by everyone. 14

Example (cont d) Type in our URL, http://cs.smu.ca/~mobileappbook, in the browser s address window. HTML5 web page: physicsprojectileapp.html 15

More HTML5 formatting High-level view of the newly formatted part of the web page. Tags <h2>...</h2> 16

Unordered and ordered lists An unordered list: a list that does not specify an order with numbers or alphabets. The complete list is enclosed in a pair of tags <ul>...</ul>. Added four items to the list using the pair of tags called <li>...</li>. An ordered list uses numbers or alphabets for listing items. 17

HTML5 tables Look at http://www.w3schools.com A table consists of rows enclosed in <tr>...</tr> tags and columns enclosed in either <th>...</th> or <td>...</td>. 18

Screenshot of a table 19

Cascading Style Sheets (CSS) Adding fonts and color information to every single page Long and expensive process. Cascading style sheets (CSS) to mitigate this problem. From HTML 4.0, all formatting can be stored in a separate CSS file. 20

Screenshot of a web page that uses a cascading style sheet 21

A cascading style sheet (CSS) The <link> tag Creating a css directory under the directory where our web page is located: ch02/physicsprojectileapp0/version3/css. 22

Adding some multimedia HTML5 called <figure>...</figure> allows us to format a figure in our web page. Often used in conjunction with a nested pair of tags <figcaption>...</figcaption>. <figcaption> allows us to provide a caption underneath the figure. 23

Augmented the page with a video The <video> tag must have a nested tag called <source>. 24

Quick facts/buzzwords <body> </body>: A pair of HTML5 tags that enclose the body section of an HTML document. <p> </p>: A pair of HTML5 tags that enclose a paragraph in an HTML document. <br>: An HTML5 tag used to add a line break in an HTML document. <sup> </sup>: A pair of HTML5 tags that are used to display a superscript in an HTML document. http: HyperText Transfer Protocol for transmitting web pages on the Internet. ftp: File Transfer Protocol for transmitting files on the Internet. scp: Secure Copy Protocol, a secure alternative to ftp. secure ftp: A secure alternative to ftp. 25