## Week 5 summary

23 Sep 2011

### HTML exercises

Here are the completed examples we worked through in class:

To experiment with them on your own, you'll have to download all 3 files (you can do that by right-clicking on the links and selecting "Save Link As..." and save them in the same directory.

### Quiz

We'll have our first quiz next week (Sep 29). It will cover the following topics:

• Number systems: binary, decimal, hexadecimal

• Converting between systems
• Binary arithmetic, including addition, subtraction, multiplication, and logical (and, or, xor) operations.
• Boolean arithmetic

• Truth tables, evaluating truth of a logical statement
• HTML concepts

• Separation between content and styling
• Tree structure
• Concepts of id and class
• General form of HTML and CSS code
• Note: you won't be expected to remember names of tags we've used, but if you're reminded of the names, you'll be expected to be able to use them.

Example questions:

1. Compute the following (assume all numbers are written in binary):

• 01101110 + 11110110
• 01101110 - 00110101
• 01101110 | 11110110 (bitwise or)
• 01101110 ^ 11110110 (bitwise exclusive or)
• 01101110 & 11110110 (bitwise and)
2. What is binary 11110000 in decimal? In hexadecimal?

3. What is decimal 123 in binary? In hexadecimal?
4. Write the truth table for (X & Y) | (X & Z) | (X & Y & Z). Can you simplify the expression?
5. Consider the following HTML, and answer all of the following questions (by specifying HTML text and where you'd insert it).

<html>
<body>
<h1>Best restaurants</h1>
<ol>
<li>The Broiler</li>
<li>Skyline Cafe</li>
</ol>
</body>
</html>

• What modifications would you make to make "The Broiler" orange and "Skyline Cafe" brown? Write what would change in the HTML, and what style blocks you'd have to add. Hint: the color property can set text color.
• How would you insert a picture immediately below "The Broiler"? Say where you would insert new elements, and what you'd insert. Hint: the img tag is used to insert picures, and the br tag inserts a line break.
• How would you make "Skyline Cafe" link to the Skyline Cafe website when you click? Hint: the a tag inserts a link, and it's used in the form <a href="destination address">Link text that you click on</a>.