lecture # 3 html and arrays. today questions: from notes/reading/life? from lab # 2 – preview of...

79
Lecture # 3 HTML and Arrays

Upload: bartholomew-richard

Post on 29-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Lecture # 3 HTML and Arrays

Page 2: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Today

Questions: From notes/reading/life?

From Lab # 2 – Preview of Lab # 2

1. Introduce: How do you make a Web Page?: HTML

2. Explain: HTML, Text Files, NotePad

3. Demo: We will do some HTML – follow on your laptop

• Practice: Your group will create an HTML page

• Evaluate: We will share and evaluate your web page

• Re-practice: Create your own web page with Lab # 2

Understand variables, Arrays and Strings

Understand Programs as sequences of instructions

Homework #2: Find the most efficient Sorting Algorithm

Page 3: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Today

Questions: From notes/reading/life?

From Lab # 2 – Preview of Lab # 2

1. Introduce: How do you make a Web Page?: HTML

2. Explain: HTML, Text Files, NotePad

3. Demo: We will do some HTML – follow on your laptop

• Practice: Your group will create an HTML page

• Evaluate: We will share and evaluate your web page

• Re-practice: Create your own web page with Lab # 2

Understand variables, Arrays and Strings

Understand Programs as sequences of instructions

Homework #2: Find the most efficient Sorting Algorithm

Page 4: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Preview Lab # 2

Page 5: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Today

Questions: From notes/reading/life?

From Lab # 2 – Preview of Lab # 2

1. Introduce: How do you make a Web Page?: HTML

2. Explain: HTML, Text Files, NotePad

3. Demo: We will do some HTML – follow on your laptop

4. Practice: Your group will create an HTML page

• Evaluate: We will share and evaluate your web page

• Re-practice: Create your own web page with Lab # 2

Understand variables, Arrays and Strings

Understand Programs as sequences of instructions

Homework #2: Find the most efficient Sorting Algorithm

Page 6: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

HTML

HyperText Markup Language

Tutorial

Page 7: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Text Files

• An array of bytes stored on disk

• Each element of the array is a text character

• A text editor is a user program for changing text files

• HTML is a text file that is written in a special language for talking to web browsers

Page 8: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

NotePad - a simple text editor

• Menu path to find NotePad• Menus are trees too!

– Start->Programs->Accessories->NotePad

• Download Notepad++ - gives color HTML tags

• Textwrangler for Macs

Page 9: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

HTML in NotePad

• <html> and </html> are called tags– Anything inside of < > in HTML is a tag

– Tags are instructions about the text for the browser

Page 10: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Publishing Web Pages

NotePad<html>

my first web page</html>

Web Browser

Computer Disk

Web Server

Internet

Page 11: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Publishing Web pages

NotePad<html>

my first web page</html>

Web Browser

myPage.html

Web Server

Internet

Save <html>my first web page

</html>

Page 12: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Special Problems with NotePad• Wants to store files as myPage.txt not

myPage.html

Page 13: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Special Problems with NotePad• Wants to store files as myPage.txt not

myPage.html

Page 14: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Special Problems with NotePad

Page 15: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Publishing Web pages

NotePad<html>

my first web page</html>

Web Browser

myPage.html

Web Server

Internet

Save <html>my first web page

</html>

Page 16: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Publishing Web pages

NotePad<html>

my first web page</html>

Web Browser

myPage.html

Web Server

Internet

Save <html>my first web page

</html>

http://there.com/myPage.html

GET

my first web page

Page 17: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Web pages on one computer

NotePad<html>

my first web page</html>

Web Browser

myPage.html

Save <html>my first web page

</html>

myPage.html

my first web page

Open Page

Page 18: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

NotePad / Web Browser Demo

Page 19: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Bold text

NotePad<html>

my <b>first</b> web page</html>

Web Browser

myPage.html

Save <html>my first web page

</html>

myPage.html

my first web page

Open Page

Page 20: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Bold Demo

Page 21: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Why didn’t bold appear?

NotePad<html>

my <b>first</b> web page</html>

Web Browser

myPage.html

Save <html>my first web page

</html>

myPage.html

my first web page

Open Page

Page 22: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Do Save

NotePad<html>

my <b>first</b> web page</html>

Web Browser

myPage.html

Save

myPage.html

my first web page

<html>my <b>first</b> web page

</html>

Open Page

Page 23: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Save Demo

Page 24: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

It Still Didn’t Appear

NotePad<html>

my <b>first</b> web page</html>

Web Browser

myPage.html

Save

myPage.html

my first web page

<html>my <b>first</b> web page

</html>

Open Page

Page 25: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Reload

NotePad<html>

my <b>first</b> web page</html>

Web Browser

myPage.html

Save

myPage.html

my first web page

<html>my <b>first</b> web page

</html>

Reload

Page 26: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Reload Demo

Page 27: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Multiple Lines

NotePad<html>

my <b>first</b> web page</html>

Web Browser

myPage.html

Save

myPage.html

my first web page

<html>my <b>first</b>

web page</html>

Reload

Page 28: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Multiple Lines Demo

Page 29: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Multiple Lines Demo

• Web browsers arrange lines according to the width of the window, not the lines in the HTML file

Page 30: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Other HTML formatting tags

• <P> make a new paragraph

• <I> </I> italic

• <ul> unordered list– <li> list item

Page 31: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

<p> paragraph

Page 32: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

<I> </I> italic

Page 33: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

<ul> <li> lists

Page 34: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

<img> - adding images

• <img src=“any URL”>– <img src=“http://students.cs.byu.edu/cs100.gif”>

• <img src=“file name”>– If the image file is in the same folder as the html

file– <img src=“cs100.gif”>

Page 35: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

<img src=“ “>

Page 36: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

How can we create hyperlinks?

Page 37: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

<a> - anchor

• Used to create hyperlinks

• <a href=“any URL”>text for the link</a>

• <a href=“file name”>text for the link</a>– Linked file must be in the same folder

Page 38: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Hyperlink Example

Page 39: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

How can we use an image as a hyperlink?

Page 40: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Image as hyperlink

Simply swap in the image tag for the text:

Instead of

•<a href=“any URL”>text for the link</a>

Use:•<a href=“file name”><img src = “MyImage.jpeg”></a>

– Linked file must be in the same folder

Page 41: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Image Hyperlink Example

Page 42: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Try it

Page 43: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

So what’s going on underneath?

Page 44: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Publishing Web pages

NotePad<html>

my first web page</html>

Netscape

myPage.html

Web Server

Internet

Save <html>my first web page

</html>

Page 45: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Web pages on one computer

NotePad<html>

my first web page</html>

Netscape

myPage.html

Save <html>my first web page

</html>

myPage.html

my first web page

Open Page / Reload

Page 46: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Today

Questions: From notes/reading/life?

From Lab # 2 – Preview of Lab # 2

1. Introduce: How do you make a Web Page?: HTML

2. Explain: HTML, Text Files, NotePad

3. Demo: We will do some HTML – follow on your laptop

• Practice: Your group will create an HTML page

• Evaluate: We will share and evaluate your web page

• Re-practice: Create your own web page with Lab # 2

Understand variables, Arrays and Strings

Understand Programs as sequences of instructions

Homework #2: Find the most efficient Sorting Algorithm

Page 47: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Group Exercise

• Using HTML create a numbered (ranked) list ofyour 3 favorite places to eat. Link the name of each place to that place’s website.

• Bold your favorite place and create a bulleted listof your 3 favorite food choices at your favorite place.

• Find a picture of your favorite food choice,display it and link it to another website.

• You have 10 minutes.

Page 48: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Share it

Page 49: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Review

• HTML is just text with special tags

• <html> </html>

• <b> </b>

• <I> </I>

• <ul> <li> <li> <li> </ul>

• <img src=“image.gif”>• <a href=“link.html”>link text</a>

Page 50: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Today

Questions: From notes/reading/life?

From Lab # 2 – Preview of Lab # 2

1. Introduce: How do you make a Web Page?: HTML

2. Explain: HTML, Text Files, NotePad

3. Demo: We will do some HTML – follow on your laptop

• Practice: Your group will create an HTML page

• Evaluate: We will share and evaluate your web page

• Re-practice: Create your own web page with Lab # 2

Understand variables, Arrays and Strings

Understand Programs as sequences of instructions

Homework #2: Find the most efficient Sorting Algorithm

Page 51: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Variables

• A named place to store a value

• AssignmentGeorge = 32;

Size = 17;

Weight = 120;

Page 52: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program

• A sequence of things to do

A = 75;

B = A+13;

A = A-B+3;

C = A/2 + 1;

Page 53: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program

• A sequence of things to do

A = 75;

B = A+13;

A = A-B+3;

C = A/2 + 1;

Page 54: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program

• A sequence of things to do

A = 75;

B = A+13;

A = A-B+3;

C = A/2 + 1; A + 13

75 + 13 = 88

Page 55: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program

• A sequence of things to do

A = 75;

B = A+13;

A = A-B+3;

C = A/2 + 1;A-B+3

75 - 88 + 3 = -10

Page 56: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program

• A sequence of things to do

A = 75;

B = A+13;

A = A-B+3;

C = A/2 + 1;A / 2 + 1

-10 / 2 + 1 = -4

Page 57: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program Quiz

• Do each in sequence

Fred = 2*7;

Jane = 16;

Fred = Jane - Fred;

Jane = Fred/2;

Page 58: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program Quiz

• Do each in sequence

Fred = 2*7;

Jane = 16;

Fred = Jane - Fred;

Jane = Fred/2;

Page 59: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program Quiz

• Do each in sequence

Fred = 2*7;

Jane = 16;

Fred = Jane - Fred;

Jane = Fred/2;

Page 60: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program Quiz

• Do each in sequence

Fred = 2*7;

Jane = 16;

Fred = Jane - Fred;

Jane = Fred/2; Jane - Fred16 - 14

2

Page 61: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program Quiz

• Do each in sequence

Fred = 2*7;

Jane = 16;

Fred = Jane - Fred;

Jane = Fred/2; Jane - Fred16 - 14

2

Page 62: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Program Quiz

• Do each in sequence

Fred = 2*7;

Jane = 16;

Fred = Jane - Fred;

Jane = Fred/2;

Page 63: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Today

Questions: From notes/reading/life?

From Lab # 2 – Preview of Lab # 2

1. Introduce: How do you make a Web Page?: HTML

2. Explain: HTML, Text Files, NotePad

3. Demo: We will do some HTML – follow on your laptop

• Practice: Your group will create an HTML page

• Evaluate: We will share and evaluate your web page

• Re-practice: Create your own web page with Lab # 2

Understand variables, Arrays and Strings

Understand Programs as sequences of instructions

Homework #2: Find the most efficient Sorting Algorithm

Page 64: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Arrays

• Access by Index

A B

Page 65: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Arrays

• Access by Index

A[0] = 7;

B[1] = 4;

B[2] = A[0]+1;

A[1] = B[2]/2;

A[3] = 7-B[1];

A B

Page 66: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Arrays

• Access by Index

A[0] = 7;

B[1] = 4;

B[2] = A[0]+1;

A[1] = B[2]/2;

A[3] = 7-B[1];

A B

Page 67: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Arrays

• Access by Index

A[0] = 7;

B[1] = 4;

B[2] = A[0]+1;

A[1] = B[2]/2;

A[3] = 7-B[1];

A B

Page 68: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Arrays

• Access by Index

A[0] = 7;

B[1] = 4;

B[2] = A[0]+1;

A[1] = B[2]/2;

A[3] = 7-B[1];

A B

Page 69: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Arrays

• Access by Index

A[0] = 7;

B[1] = 4;

B[2] = A[0]+1;

A[1] = B[2]/2;

A[3] = 7-B[1];

A B

Page 70: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Arrays

• Access by Index

A[0] = 7;

B[1] = 4;

B[2] = A[0]+1;

A[1] = B[2]/2;

A[3] = 7-B[1];

A B

Page 71: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Strings

• An array of Characters

A=“Lloyd”;

B= “Big”;

B[2] = A[0]+1;

A B

Page 72: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Strings

• An array of Characters

A=“Lloyd”;

B= “Big”;

B[2] = A[0]+1;

A B

Page 73: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Strings

• An array of Characters

A=“Lloyd”;

B= “Big”;

B[2] = A[0]+1;

A B

Page 74: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Strings

• How do you put “ in a string?

• Special characters preceded by \

A=“Lloyd”;

B= “Big”;

B[2] = A[0]+1;

B = “\”P\\”

A B

Page 75: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Sound• Each time samples the volume (amplitude)• Sound = array of volume values

Page 76: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

2D-Arrays

[Rows-1,Columns-1]

5

10

[4,9]5 * 10 = 50

Page 77: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Images - 2D array of values

• Image [x,y]

Page 78: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Today

Questions: From notes/reading/life?

From Lab # 2 – Preview of Lab # 2

1. Introduce: How do you make a Web Page?: HTML

2. Explain: HTML, Text Files, NotePad

3. Demo: We will do some HTML – follow on your laptop

• Practice: Your group will create an HTML page

• Evaluate: We will share and evaluate your web page

• Re-practice: Create your own web page with Lab # 2

Understand variables, Arrays and Strings

Understand Programs as sequences of instructions

Homework #2: Find the most efficient Sorting Algorithm

Page 79: Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML

Homework #1: Most Efficient Sorting Algorithm

• Find what you consider to be the most efficientSorting Algorithm.

• Write the algorithm as Problem 1 in Homework 1

• Explain why you consider it to be the most efficient Sorting Algorithm.

• Describe its efficiency mathematically.