CSCI 107 - Introduction To Web Programming
Spring 2024


HTML Topics: Lesson 01  ⧫  Lesson 02  ⧫  Lesson 03  ⧫  Lesson 04  ⧫  Lesson 05  ⧫  Lesson 06  ⧫  Lesson 07  ⧫  HTML Wrapup
CSS Topics: Lesson 08  ⧫  Lesson 09  ⧫  Lesson 10  ⧫  Lesson 11  ⧫  Lesson 12  ⧫  Lesson 13  ⧫  Lesson 14
JS Topics: Lesson 15  ⧫  Lesson 16  ⧫  Lesson 17  ⧫  Lesson 18
Lesson 1 - Internet and WWW Overview
Main Topics
  • History of the Internet
  • How the Internet Works
  • History of the World Wide Web
  • World Wide Web Basics
Key Terms and Concepts
  • First Electronic Computer
  • ARPANET / NSFNET
  • Network
  • Internetwork
  • Internet Protocol Model (Layers)
  • TCP/IP
  • Packet
  • IP Address
  • Flow Control / Time to Live
  • World Wide Web / Tim Berners-Lee
  • Mosaic / Netscape
  • Browser Wars
  • World Wide Web Consortium (W3C)
  • Domain Name / Virtual Domain
  • FQDN (Fully Qualified Domain Name )
  • DNS (Domain Name Service)
  • Virtual Hosting
  • URL (Uniform Resource Locator) / URL Structure


Resources

Homework
Read all sections - Due Monday, Jan. 22nd
Objective: Complete reading the entire document.

Lesson 2 - Publishing Web Pages
Main Topics
  • Skeletal HTML Document Structure
  • Publishing Pages to a Web Server
  • Local Development Pages vs Live Pages
Key Terms and Concepts
  • Code Editor
  • HTML Document
  • Web Server Account
  • FTP Client / SFTP


Resources





Lesson 2 Lecture Recordings



Resources

Class Recording on HTML Pages and Publishing

Lab#1
Lab # 1 - Publish Your First Main Web Page and lab1.html - Due Jan. 28th, @ 9 p.m.
Objective: Creating 2 HTML files
  • Part 1: Create a web page and name it "index.html". This is the main page of your website. You will build on it throughout this course.
  • The topic for the page is entirely up to you as long as it's appropriate for class (keep it clean). Common themes students choose include their hobby, favorite sports team, favorite band, etc, just to name a few of the many possibilities.
  • To create the page, start with a blank document in whichever code editor you decide to use.
  • Once the file is saved then check if it works by double clicking on the html page. If your file name does not properly end with .html, the browser may show the HTML source code instead of the rendered Web page, which is not what you want. Each time you edit/save the file, simply hit refresh/reload in the browser to see your changes. This is your "Local" web page saved on your hard drive.
  • You must use at least 3 paragraph elements, and 2 of any heading level elements.
  • Part 2: Now create another file and name it "lab1.html". In this page you will add a few paragraphs that define and explain the following: HTML, Web Server, ARPANET, WWW, Domain name, http, W3C and URL. This is the test of your reading and note taking.
  • You must use a paragraph element for each definition and there should be a heading level for each paragraph. (use level 3 heading for this!)
Technical Requirements:
  • Your HTML code should have the basic HTML5 Example structure for both web pages.
  • Your code should be properly formatted (tabbed elements when needed, lowercase element names)
  • You must supply a custom page title for each page and the page body content should follow the instructions already stated.
  • When I surf to your public address/URL (http://csci.lakeforest.edu/~username) I must be able to find your page.
  • Upload the following file on Moodle under Lab#1:
    • Create a word document and name it your_first_name_lab1.doc
    • In this word document, do the following:
      1. At the top of this document write your full name and section number.
      2. Then write the 2 links as follows:
        • One link to your main page.
        • One link to your lab1.html as http://csci.lakeforest.edu/~username/lab1.html
      3. Then take the screenshot of code from text editor of both index.html and lab1.html and paste in your word document below the link.
      4. Then upload this word doc on Moodle under Lab#1.
Lesson 3 - HTML Introduction
Main Topics
  • What is a Markup Language?
  • Nature of an HTML5 Document
  • Introduction to Common HTML Elements

Key Terms and Concepts
  • Whitespace
  • Inline Elements vs Block Elements
  • Empty Elements vs Container Elements
  • HTML Comment Markers
  • HTML Character Entities
  • Semantic Elements
  • Hiding Directory Listings


Resources Note: You absolutely must download and read the HTML examples provided above. Those examples, together with readings I provide, are effectively your textbook for the course. It is recommended that you make a folder named CSCI107 Course Materials (or whatever name you want) in your Desktop or in your Documents folder. If you right click on the link for the zipped examples above and select "Save Link As" (or similar), you can choose where to save the examples. If you simply click on the download zip link, it will save in your Downloads folder.





Lesson 3 Lecture Recordings



Resources

Class Recording on Inline-Block Level Elements & Character Entities

Homework
Lab # 2 - Adding more HTML Elements to Your Page - Due Feb. 4th @ 9 p.m.
Objective: Incorporate most of the HTML concepts introduced in this lesson by creating a file and calling it "lab2.html". Content for this page can be anything but it will be better if you keep it relevant to your main page.

Note: It doesn't help to try to work ahead if you already know some HTML beyond this lesson. Homework is assessed according to the technical requirements for that lesson. Working ahead is not given extra credit, and may actually cause your page to diverge from the planned direction of the lessons in this course.
  • In order to use the HTML elements introduced in this lesson, you will likely need to expand the content.
Technical Requirements:
  • For the purposes of easier grading and readability, add a comment line before a paragraph which will be using the following elements required for this lab. For example: If your paragraph uses a break element (br) and/or inline elements, you will write a comment before this paragraph saying something like "The following paragraph uses br and other elements..." This way I will be able to see your use of the element and how it's displayed.
  • At a minimum, use all of the following HTML elements in your page. But feel free to also use any introduced in this lesson.
    Breaks - br, hr
    Inline - b, i, small, mark, code
    Blocks - p, pre, two different header levels (h1, h2, ..., h6)
  • Give a heading to this page that says something like "Lesson 3 - Lab#2". This way you will know which lab belongs to which lesson
  • Use at least two different Character Entities to create special characters in your page. Use at least one character entity for a non-breaking space (nbsp) since those are very useful in practice since browsers ignore normal whitespace.
  • There is one comment at the top of this page -- the kind that are only for humans and Web browsers totally ignore when they read the HTML code. In this comment explain what this page or the lab#2 is about.
  • When I surf to your public url (csci.lakeforest.edu/~username/lab2.html), your lab2.html should load rather than a directory listing of what's in your public folder.
  • Your page should have the proper skeletal format (doctype,html,head,body) as directed in Lesson 2, as should all future pages. Also, all page content goes into the body section. Only title should be added to the head section for this assignment.
  • Upload the following file on Moodle under Lab#2:
    • Create a word document and name it your_first_name_lab2.doc
    • In this word document, do the following:
      1. At the top of this document write your full name and section number, e.g. Jane Doe - Section 1 or 2
      2. Then write the link to your lab2.html as http://csci.lakeforest.edu/~username/lab2.html
      3. Then take the screenshot of code from text editor of lab2.html and paste in your word document below the link.
      4. Then upload this word doc on Moodle under Lab#2.
Lesson 4 - HTML Attributes
Main Topics
  • Controlling HTML elements with Attributes
  • Metadata for Web Pages
  • Brief History of HTML
Key Terms and Concepts
  • HTML Attribute
  • HTML Syntax Guidelines
  • Hyperlinks (Links)
  • Title Attribute / Tooltip
  • Universal Attributes
  • Meta Elements
  • Mailto Links
  • Deprecated HTML


Resources

Homework
Lab # 3 - Adding Attributes to your Pages - Due Feb. 11th @ 9 p.m.
Objective: Creating External Links and Mail-to link
  • Create a new file and name it "lab3.html"
  • In this lab, create a page of your interest. Make sure you have at least 5 paragraphs in this page.
Technical Requirements:
  • Make sure there is a heading of "Lab#3 - Lesson 4" at the top of this page.
  • Add at least 5 links to external Web sites for each of the 5 paragraphs to support the theme of your page. For example, if your page is about Tennis, then link to 5 Web pages that have something to do with Tennis. Make sure there is separation between each link (You can use a horizontal rule or new lines to separate them).
  • New Addition: Add a title attribute to the first paragraph such that when the cursor hovers on that paragraph a 'Tooltip' - the little box- that pops up when you hover over something.
  • Add a mailto link at the bottom of your page content near the end of the body section.
  • Proper syntax - all attribute values in your page should be in quotations. All elements should be properly indented.
  • Your page should have the proper skeletal format (doctype,html,head,body).
  • Submission follows the same structure as previous labs.
Lesson 5 - Graphics
Main Topics
  • Adding Graphics (Images) to Web Pages
  • Different Formats for Web Graphics
  • How HTTP Delivers Graphics
Key Terms and Concepts
  • HTML Image (img) Element
  • Resizing / Aspect Ratio
  • Organizing Graphics / Relative URLs
  • Graphics as Links
  • Pixels
  • File Size vs Image Dimensions
  • Image Delivery / HTTP Keep Alive
  • Differences (gif vs jpeg vs png)


Resources





Lesson 5 Lecture Recording



Resources

Class Recording on HTML Images



Homework
Lab # 4 - Adding Graphics to Your Page - Due Feb. 18th @ 9 p.m.
Objective: In this lab you will be adding images to your web page.

  • Create a new file and name it lab4.html. Name the file EXACTLY as mentioned in the labs! Most of the times it's not your code rather file names that you don't reference correctly!
  • lab4.html should have at least 3 paragraphs about the topic you choose.
  • Find 5 images online for the following: one for a mailbox, at least 3 images that are placed at the end of each paragraph, and one image of Facebook that takes you to Facebook's main/home page. Make sure the images relate to your topic. When you find a graphic on the Web, in most cases, you can right click on it to download it to your computer. You may even be able to drag it straight from a Web page onto your computer. If it has a long, crazy file name, rename it to something simple and descriptive. I recommend using all lowercase with no spaces in the file names (see troubleshooting tip on case sensitivity).
  • Place a link at the top of the page that will take the user to your main/home page (relative URL).
  • Place a clickable Mailbox image at the bottom of the page that will take the user to the mail interface (relative path)
  • Place a clickable Facebook image after the mailbox that will take the user to Facebook's home page (Absolute URL & relative path)
Technical Requirements:
  • Meet the image requirements listed above and make sure the images all show up in your lab4.html page. There are some troubleshooting tips below in case they don't.
  • The Home link should be on the top left of the page, The clickable Facebook image and the clickable Email image is at the bottom left of the page.
  • The src values that locate the graphics for your page must be relative path name, not absolute URLs.
  • Your page should still maintain the proper format and proper indentation.
  • Make sure the images are properly sized relative to your page. Remember to use the width and height attribute to re-size your images if needed.
Troubleshooting Tips: If your images work locally on your computer, but won't show up in your live page on the server:
  • Make sure all the images are inside the Images folder and all the labs are inside the Labs folder.
  • Make sure you copied the images and the images folder onto the server, in addition to your updated HTML file. For example, if your image is named 'mypic.gif' locally on your computer, then all of your src attributes will be like src="mypic.gif". That still has to be accurate on the server, so you have to copy the images to the server. You are building the site locally, and the exact structure has to be preserved when copying to the server.
  • The Linux server is Case Sensitive. That means, src="pics/mypic.gif" WILL NOT match pics/Mypic.gif on the server. However, both Mac and Windows are not case sensitive. That means if you are not careful about matching the file names exactly, images might show up in your page locally, but not once your site is copied to the server. That is why I recommend using all lower case with no spaces in file names.
  • If you are positive that you transfered your images to the server, the relative URLs are correct, and the file name exactly matches your img src, then it could be a permissions issue.
Lesson 6 - Relative URLs and Internal Linking
Main Topics
  • Internal Linking and Relative URLs
  • Structured Web Sites
  • Linking to Locations within a Page
Key Terms and Concepts
  • Relative vs Absolute URLs
  • Up One Directory (../) vs Down
  • Portable Web Site
  • Linear vs Hierarchical Site Structures
  • Page Anchors / ID Attributes
  • URL Fragments


Resources
  • Examples: download zip  |  view online   (The zip download gives best access to source code in your code editor. Viewing online is for quick access.)
  • Lecture Slides: view PDF online  |  download PowerPoint   (The PDF loads directly in your browser. The PowerPoint download requires Microsoft Office software.)



Homework
Lab # 5 - Add Structure to Your Site - Due Feb. 25th @ 9 p.m.
Objective: Creating 2 new pages: "lab5.html" and "default.html" in a new folder named "Labs", and link your pages together. This "default.html" is the Main page for Labs and it will be a place to add links to stand-alone labs so that you won't have to clutter up your Main/Home page with various links that have nothing to do with its topic/theme. The folder "Labs" will contain a Labs Home Page called "default.html" and "lab5.html" and the old Labs you have done so far.


Site Structure Diagram for Lesson 6



Overview of Site Structure - shown in the diagram to the right.
The names of your image files might be a little different but the lab and folder names should be the same.
  • The index file is your Main Home page.
  • The Images folder should already exist from the last lab.
  • The folder Labs and default.html and lab5.html are new for this assignment.
    Folder name should be exactly Labs and the files names should be exactly as mentioned above


  • Create the new folder as described above and move your old labs inside it including lab5.html you created.
  • Instructions to what goes inside default.html page:
    • Change the information in the head section (title) to something appropriate for this new default.html page.
    • Display as a heading something like "CSCI 107 Labs Page" as page content so it's apparent what the page is.
    • Near the top of the new default.html page, add a back home clickable image link that will go back to your home page when clicked.
    • Below the back home clickable image, add links to each of your lab pages you have done so far including lab5.html
    • At the top of your Home Page(index.html), add a link to your new page (inside your Labs folder): default.html. Put it near the top so I can find it easily. Text is ok for this link.
    • The result of this is that I can surf to your home page and click on a link to go to your Labs page. In your Labs' main page, I can find links to find all your labs(lab1.html,lab2.html,lab3.html,lab4.html, lab5.html). Finally, I can click on the small house icon at the top of the Labs page to get back home. Thus, your site now has structure and internal linking.
  • Instructions for each lab (lab1.html, lab2.html,lab3.html,lab4.html,lab5.html)
      Each of these labs should have a "Back To Home" link that takes you to index.html
  • Instructions to what goes inside lab5.html:
    • Make this lab a "Contact Us" page in which you should have a Clickable home image, clickable mail image, and a fieldset that displays the address and the phone number of your company.
    • There must be anchor links within this page. Create a "Go to bottom" link at the top of this page that takes you to the bottom of the page. This means you must have a lot of content about contact info in this page. > Create a similar link at the bottom of the page something like "Contact Info" that takes you to the top of the page.
Technical Requirements:
  • Meet the structure/content requirements listed above
  • You must use Relative URLs for all the internal links within your site, and all the links should work (obviously).
  • The back home link shoud be a small House graphic, rather than text.
  • In default.html: Make sure there is a link in the beginning of the page that takes you to the bottom of the page and a link at the bottom of the page that takes you to the top of the page. (Anchor links within a page)
  • There is proper formatting.
  • Each page (labs.html,lab1.html,lab2.html,lab3.html,lab4.html,lab5.html)has a clickable image back to index.html
  • In addition to index.html link in each lab page, all the labs(lab1.html,lab2.html,lab3.html,lab4.html,lab5.html) should also have a link back to the main lab page.
  • Submission: Place a screenshot of default.html and lab5.html in the word document. Make sure this document has the following links:
    • http://csci.lakeforest.edu/~username (this should take you to your website's main page)
    • http://csci.lakeforest.edu/~username/Labs (this should take you to your Lab's main page)
    • http://csci.lakeforest.edu/~username/Labs/lab5.html
Troubleshooting Tip: If any of your links or images work locally on your computer, but don't work after you publish to your live site on the server, the same Troubleshooting Tips from the previous lesson still apply, in particular the Case Sensitivity issue. Double check your file names-- .jpeg is different from .Jpeg

Lesson 7 - Structured Block Elements
Main Topics
  • Block Elements with Internal Structure
  • Table Structure and Merging Cells
Key Terms and Concepts
  • Fieldset / Legend
  • Ordered List / Unordered List
  • Nested List
  • Table / Row / Cell


Resources
  • Examples: download zip  |  view online   (The zip download gives best access to source code in your code editor. Viewing online is for quick access.)
  • Note: I didn't link to the W3Schools pages for Lists and Tables here because they mix in CSS code (Cascading Style Sheets) with their HTML examples. My examples feature the core HTML for these structures, leaving CSS for later lessons.



Lab#6
Due Sunday, 3/3 @ 9:00 p.m.
Objective: Creating HTML Fieldsets and Tables

  1. Part 1: Create a new web page and name it "lab6.html" and place it inside "Labs" folder. In this page do the following as described in class:
    1. Create an HTML table that has 4 rows with 4 table headers. The 4 table headers should have the values as 'Street Number', 'Street Name', City, & State. Make up appropriate address values.
    2. Create an HTML fieldset that has at least 2 images of your choice.
  2.  
  3. Part 2: In your default.html do the following:
    1. Add a link to lab6.html as you did for other labs. This you will be doing it for every lab from now on so i won't be mentioning it every time.
    2. All your 6 labs should have a home button and a link to labs page
Technical Requirements:
  • Meet all the requirements as mentioned in class lecture.
  • Make sure there is proper formatting.
  • Make sure there are links to all 6 labs you have done in a list format in "default.html"
  • Make sure every lab page has a link to "default.html" at the top of its page and a home button that takes you back to index.html
  • Submit the document with a screenshot of default.html and lab6.html. Again, this should be the standard submission format moving forward. Point deductions will occur for non-compliance.
  • For submission, make sure you have the following working links in your word document:
    • http://csci.lakeforest.edu/~username
    • http://csci.lakeforest.edu/~username/Labs




Lab#7
Due Sunday, 3/3 @ 9:00 p.m.
Objective: Creating HTML Lists

  1. Part 1: Create a new web page and name it "lab7.html" and place it inside "Labs" folder. In this page do the following as described in class:
    1. A Simple List with at least 5 list items
    2. A Nested List with at least 5 list items and within each of these list items there should be at least 2 sub-items.
    3. An Out of order list that starts with roman numeral 'ix' and has 5 list items. -
  2. Part 2: In your default.html do the following:
    1. Create a list of links in this page. All you have to do is to add the links as content to your list items.
    2. Add a link to lab7.html as you did for other labs. You will be doing this for every lab from now and it should be given that you will do this own your own for every new lab you do.
    3. All your 7 labs should have a home button and a link to labs page. Again, you will do this for every page moving forward.
Technical Requirements:
  • Meet all the requirements as mentioned in the lecture.
  • Make sure there is proper formatting.
  • Make sure there are links to all 7 labs you have done in a list format in "default.html".
  • Submit the document with a screenshot of default.html and lab7.html. Again, this should be the standard submission format moving forward. Point deductions will occur for non-compliance.
  • For submission, make sure you have the following working links in your word document:
    • http://csci.lakeforest.edu/~username
    • http://csci.lakeforest.edu/~username/Labs


Extra HTML Topics
Main Topics
  • HTML Topics not Covered in the Previous Lessons
  •  
  •  
  • The goal of the HTML portion of this course isn't to teach every HTML element and topic. One goal is to teach the core HTML concepts so you have the background to understand additional HTML features should the need arise. Another goal is to teach the HTML concepts you will need to begin learning Cascading Style Sheet basics in the next portion of the course. Nonetheless, it's worth taking the time to peruse these extra HTML examples so that you are at least aware of more useful things HTML can do.
Key Terms and Concepts
  • HTML Semantic Elements
  • HTML Data Collection Forms
  • Inline Frames (iframe)
  • Embedding Audio and Video
  • Favicons


Resources

Homework
No Homework for This Lesson
This material will NOT be on Exam #1, or any exam for that matter.



Lesson 8 - RGB Colors
Main Topics
  • How Computer Screens Display Colors
  • The Color Notations Used in Web Pages
  • Introduction to Fonts for Web Pages
Key Terms and Concepts
  • RGB Primary Color Shades
  • Low Saturation vs High Saturation
  • Base 10 RGB Notation
  • Hexadecimal Color Notation
  • Web Safe Colors
  • Additive vs Subtractive Colors
  • Limitations of Named Colors
  • Web Safe Fonts


Resources

Homework
Read the RGB Colors Overview - No Web Site Update for This Lesson
This material will NOT be on Final Exam.

Lesson 9 - CSS Introduction
Main Topics
  • CSS Syntax Overview
  • Embedding an Internal Style Sheet in a Web Page
  • CSS Box Model for Blocks
  • Fundamentals of Styling Blocks
Key Terms and Concepts
  • Units in CSS
  • Shortcut Notation (TRBL, etc)
  • Internal Style Sheet / HTML style Container
  • Generic vs Element-Specific Style Classes
  • CSS Box Model
  • Default Block Behavior (vertical vs horizontal)
  • Centered Content inside Blocks
  • Centering Blocks


Resources

Homework
Internal Style Sheets. Time to style one page at a time! - Lab # 8 -- March, 17th @ 9:00 p.m.

Objective: Styling lab8.html with CSS

  • Create a web page and name it "lab8.html" in Labs folder and style the content as follows:
    • Divide your page into 3 sections as follows (hint: use div element around the elements for each section):
      1. One top most section which has:
        • A centered clickable home image that takes you to your main page (index.html)
        • There is one centered heading (h1) after the home page image, give a color to this heading
      2. One middle section which has:
        • At least 4 paragraphs, each with a level 2 heading that is centered and colored other than black and color of h1, and paragraph's text also has a color of your choice. Make sure the the text color is legible which is easy and bright enough to read.
      3. One bottom section which has:
        • A copyright sign with 2023 next to it (look at other websites to get some idea)

Technical Requirements:

  • This page is styled using internal style sheet.
  • There's a background color and a border given to the div sections.
  • There's a background color to this entire page.
  • Make sure to add lab8.html to your links in labs.html page.
  • All pages are visually appealing such that visitors want to visit your website.
  • Submission: Place a screenshot of lab8.html and a link to this lab in the word document to upload on Moodle.


Lesson 10 - CSS - Styling HTML Page
Main Topics
  • The Division of Labor between HTML and CSS
  • Importing External Style Sheets into Web Pages
  • Selecting HTML Elements for the Application of Styles
Key Terms and Concepts
  • External Style Sheet
  • HTML span and div Elements
  • What is a CSS Selector in general?
  • Element (Type) Selector
  • Class Selector / Style Class
  • HTML class Attribute
  • Why Limit the Use of Element (Type) Selectors?


Resources
  • Examples: download zip  |  view online   (The zip download gives best access to source code in your code editor. Viewing online is for quick access.)
  •  
  • The resources for this Lesson don't include W3Schools intro CSS pages because they can be confusing to beginners.
    This course introduces CSS slowly from the ground up and will point to appropriate W3Schools CSS pages after you have learned enough fundamentals.

Homework
CSS Classes & External Style Sheets - Lab # 9 -- March, 17th @ 9:00 p.m.

Lab#9 - Objective: Using External Style Sheet to Style "lab9.html"

  • Create an html file and name it "lab9.html" file.
  • Create a new text file and name it "lab9.css". Place this file in Labs Folder. All the styles for lab9.html will go into this external css file you just created.
  • Style this page as follows:
    1. There is one left aligned clickable image at the top of your page that takes you to your main page (index.html) and a centered clickable image to (default.html) page that appears below the homepage link.
    2. This page must be divided into at least 3 sections using div element and inline styling is done using span.
    3. There are at least 4 paragraphs(text color for each paragraph should be different) each with an image to their left, and with a heading that is left-aligned (text color for each heading is different)
    4. There's a border of different style for each div section, and each div section has a different color for background.
    5. There is a blue border and a background color of lightgrey to this entire page.
  • Upload both lab9.html and lab9.css on the server.
-->

Technical Requirements:

  1. lab9.html is styled with external style sheet only.
  2. All styles show up, there are no missing images, and no broken links.
  3. There is proper indentation in both files (html and css).
  4. Submission is same as before. Make sure to put a link to lab9.html, a screenshot of both lab9.html and lab9.css file, and follow the rest of submission requirements for the word document.


Lesson 11 - Styling Links and Creating Navigation Bars
Main Topics
  • The Concept of Cascade - the C in CSS
  • Styling Links and Nav Bars
  • More Selectors: Pseudo Class, Grouped, Contextual
Key Terms and Concepts
  • Cascade / Specificity of Selectors
  • HTML style Attribute (Inline Styles)
  • Pseudo Classes / Link States
  • Button Links
  • The inline-block Style Property
  • Nav Bars / Styling Lists of Links
  • CSS Grouped Selectors
  • CSS Contextual Selectors / Curing Classitis


Resources

Lesson 10 -- Recordings



Homework
Pseudo-Classes and Nav. Bars - Lab#10 & Lab#11 -- March, 24th @ 9:00 p.m.

Lab#10

Objective: Using Pseudo-classes & Creating Vertical Navigation Bar
  • For this lab you are making changes to your 'default.html' page
  • Give this page a heading that is centered. Then style this page's links using pseudo-classes (Use internal style sheet).
  • Create a vertical navigation bar. There should be at least 3 menu bar items as mentioned in Lab-11 below.
  • The main heading for the 'default.html' page and the links to all labs in this page should have a hover state.
  • Also make sure that there are links to all the 11 labs we have done so far.

Lab#11

Objective:Creating Horizontal Navigation Bar.
  • For this lab, you are working on 'index.html'
  • Styles for this page will go into internal style sheet.
  • Create a horizontal navigation bar on top of this page with the menu items: Home(link to index.html), Labs(link to default.html), About(link to a page-- write something meaningful in this page), Contact(link to a contact page and there should an email clickable image link). Give this navigation bar a dark background color and change the background color of the links when the user moves the mouse over them.
  • This page must display what you have been wanting for your main page to look like so make it look professional with appropriate content like creating a disclaimer section at the bottom of this page.
Technical Requirements:
  • Meet the link/nav requirements listed above.
  • The hover links and nav bar should be styled to match the color theme of your pages.
  • Follow submission rules as before by uploading any new or updated file links.


Lesson 12 - Creating Columns with CSS
Lesson 13 - Inserting Graphics with CSS
Lesson 14 - Page Layout Design
Main Topics
  • Using Blocks to Create Full-Page Layout Designs
  • Very Brief Introduction to Responsive Design
Key Terms and Concepts
  • CSS ID Selectors
  • Centered Content / Width Considerations
  • Full-Width Stripes with Centered Content
  • Columns in Layout Design
  • No-Scroll Header/Footer
  • Semantic Block elements


Resources
  • Examples: download zip  |  view online   (The zip download gives best access to source code in your code editor. Viewing online is for quick access.)
  •  
  • W3Schools Responsive Web Design Page shows how page design is being affected by the proliferation of smart phones and tablet computers. None of the examples in this lesson feature responsive design because that is well beyond the scope of this course. However, maybe this will motivate you to want to further your studies in Web Design!

No Homework - Just Practice on your own
Lesson 15 - JavaScript Introduction
Main Topics
  • The Concept of Scripting - The 'Script' in JavaScript
  • Traditional Top-Down Input/Output Programming
  • Conditional Logic - How Computers are Programmed to Make Decisions based upon Human Logic
Key Terms and Concepts
  • Prompt Windows
  • Variables / Rules for Variable Names
  • Data Types - Strings/Numbers/Special
  • String Concatenation
  • Types of Errors in JavaScript
  • Browser Error Console
  • The Variable Assignment Operator
  • Comparison Operators
  • Boolean Data Type
  • Logical Operators / AND vs OR Truth Tables
  • Conditional Statements
  • Compound Conditional Statements




Resources
  • Examples: download zip  |  view online   (The zip download gives best access to source code in your code editor. Viewing online is for quick access.)
  •  
  •  
  • The JavaScipt Lessons in this course don't link to many W3Schools pages. Their JavaScipt pages are good reference for someone who already knows how to program in some other language and wants to learn JavaScript. But they aren't good reference for someone who doesn't know core programming fundamentals (variables, conditionals, loops, objects, etc). The JavaScript lessons in this course introduce core programming fundamentals from the ground up, assuming no prior programming experience whatsoever.


Lab # 12 ~~ Due: Sunday, April. 7th @ 9 p.m.

Objective: ** Building a Mini-Calculator **
  1. Create a web page and name it lab12.html and save it in your Labs folder. Style this page with internal sheet that gives this page a background color of your choice. You can style this page more if you want.
  2. Write a JavaScript Input/Output program that asks the user to enter 4 numbers. Your program should do the following:
    • Calculates the sum of the first 2 numbers entered by the user (use '+' operator).
    • Calculates the multiplication of the 3rd and the 4th number entered by the user (use '*').
    • Calculates of the cube of the 3rd number entered - raised to the power 3 - (use '**').
    • Calculates of the division such that the 4th number is divided by the 1st number (use '/').
    • Calculates of the remainder of the 2nd number divided by the first number (use '%').
  3. Display a proper message for each calculation. For example if the user enters the 4 numbers as 10, 20, 30, and 40 then the following is displayed:
    1. For Addition, your program should display: "The sum of 10 & 20 is: 30".
    2. For multiplication, your program should display: "30 multiplied with 40 is: 1200"
    3. For Exponentiation, your program should display: "30 to the power 3 is: 27000".
    4. For Division, your program should display: "40 divided by 10 is: 4".
    5. For the Remainder, your program should display: "20 divided by 10 has a remainder of: 0 ".


    Technical Requirements:
    • Upload the word document to Moodle (word doc with the link to this lab, screenshot of code, and the output).
    • All calculations are accurate.
    • JavaScript code is formatted properly.
    • Update default.html page with all the links to new labs you create from now on.
    • This page has a link to home and to default.html.

Lab # 13 ~~ Due Sunday, April. 7th @ 9 p.m.

Objective: ** Creating Mad Libs **

  • Create a web page and name it lab13.html and save it in your Labs folder.
  • Write a JavaScript Input/Output program that does the following:
    1. Asks the user to enter at least 4 words that are a specific part of speech (e.g. noun,verb,adjective,adverb).
    2. The output should insert the user's words into one or more sentences like in a "Mad Lib." Please, no vulgarity!
    3. For example, if the user enters the words as 'cat', 'ran', 'ugly', 'rarely'. You program will create a story by using these words entered by the user. The story is displayed as: Yesterday(adverb) I saw an athletic cat(noun). The bus ran(verb) over the cat(noun). The road was ugly(adjective).

If you don't know what a Mad Lib is, see http://en.wikipedia.org/wiki/Mad_Libs

Technical Requirements:
  • Upload the word document to Moodle (word doc with the link to this lab, screenshot of code, and the output).
  • Output should be properly formatted and easy to read.




Lesson 16 - Conditional Statements
Main Topics
  • Conditional Logic - How Computers are Programmed to Make Decisions based upon Human Logic.
Key Terms and Concepts
  • Comparison Operators
  • Boolean Data Type
  • Logical Operators / AND vs OR Truth Tables
  • Conditional Statements
  • Compound Conditional Statements




Resources
  • Examples: download zip  |  view online   (The zip download gives best access to source code in your code editor. Viewing online is for quick access.)



Resources

Class Recording on JavaScript Conditional Statements


Lab # 14 - Due Tuesday, 4/16 @ 9 p.m.

Objective: ** Transcript **

1. Create a file and name it lab14.html. Place this file in the Labs folder. Then, in this file, write the following program:

 Ask the user to enter their score. If their score is less than 60 then the grade is an 'F', 
  if the score is greater than or equal to 60 then and less than 70 then grade is a 'D', 
  if the score is greater than or equal to 70 then and less than 80 then grade is a 'C',
  if the score is greater than or equal to 80 then and less than 90 then grade is a 'B', 
  otherwise their grade is an 'A'. 
  Then your program displays the grade with a proper message. 
  For example, if the user enters 91 then your program should display the message saying: "Your grade based on your score of 91 is A!"

Technical Requirements:

1. Upload the word document to Moodle (word doc with the link to this lab, screenshot of code, and the output).

2. Displayed message matches the condition in the program.

3. JavaScript code is formatted properly.

4. Create a link to this file in default.html page.

5. This page has a link to home and to default.html.


Lab # 15 - Due Tuesday, 4/16 @ 9 p.m.

Objective: ** Age Factor **

1. Create a file and name it lab15.html. Place this file in the Labs folder. Then, in this file, write the following program:

 Ask the user to enter their age. If their age is greater than 16(inclusive) but less than 18(not inclusive), then print a message saying, "Given your age, you can only drive right now!",
  if their age is greater than 18(inclusive) but less than 21(not inclusive), then print a message saying, "You can Drive and Vote!", 
  if their age is greater than or equal to 21, then print a message saying, "You can drive, vote, and have your own insurance!", 
  otherwise print the message saying, "You are too young!". 
  For example, if the user enters 20 then your program should display the message saying: "You can Drive and Vote!"

Technical Requirements:

1. Upload the word document to Moodle (word doc with the link to this lab, screenshot of code, and the output).

2. Displayed message matches the condition in the program.

3. JavaScript code is formatted properly.

4. Create a link to this file in default.html page.

5. This page has a link to home and to default.html.


Lesson 17 - Loops for Iteration
Main Topics
  • Iteration - How Computers are Programmed to Execute Instructions Repetitively
Key Terms and Concepts
  • Validating User Input with JavaScript
  • The while Loop
  • Loop Counters / Infinite Loops


Resources
  • Examples: download zip  |  view online   (The zip download gives best access to source code in your code editor. Viewing online is for quick access.)

Homework

Lab # 16 ~~ While Loop Tracing-- Due Wednesday, April 17th @ 10 a.m.

Lesson Objective: Variable Tracing in a While Loop Context


Lab#16 ** While Loop Variable Tracing **

Objective: Complete the variable tracing of the document handed in class.
  •  
  • Create a file and name it lab16.html
  • Place this file in the labs folder.
  • Then, in this page upload the image of the variable tracing.

Technical Requirements for lab16.html:
  • There's proper variable tracing and Output displayed.
  • There should be a link to this page in your labs.html page.
  • Make sure you upload your work on Moodle as you have done before.
  • Turn in your variable tracing in class to the professor




Lab # 17 ~~ While Loop -- Due Sunday, April. 21st @ 9 p.m.

Lesson Objective: Understanding while loops


Lab#17 ** While Loop **

  •  
  • Create a file and name it lab17.html
  • Place this file in Labs folder.
  • Then, in this file, Write a JavaScript Input/Output program that converts Fahrenheit temperature to Celcius. The formula is provided below. Your program needs to decide whether the temperature is above or below the freezing point? The output should explain whether the temp is above/below freezing and by how much. Use a loop so that the user will keep getting prompted whether they want to continue the program or not.

   C = (5/9)*(F - 32)
Technical Requirements:

1. Upload the word document to Moodle (word doc with the link to this lab, screenshot of code, and the output).

2. Displayed message matches the condition in the program.

3. JavaScript code is formatted properly.

4. Create a link to this file in default.html page.

5. This page has a link to home and to default.html.




Lesson 18 - Events and Functions
Main Topics
  • Reacting To User Events - Event-Driven Programming
Key Terms and Concepts
  • Dialog Windows (Prompt/Confirm/Alert)
  • JavaScript Functions
  • General Event Handlers (onclick/onmouseover ...)
  • Writing to the Browser's Console Log
  • Page-Level Events (onload/onscroll ...)
  • Timed Events
  • Page State / Global Variables




Resources
  • Examples: download zip  |  view online   (The zip download gives best access to source code in your code editor. Viewing online is for quick access.)
  •  
  •  



- Lab # 18 -- Due Sunday, 4/28 @ 9 p.m.
Objective: Functions & Dialog/Pop Up Boxes.
  • Create a new file lab18.html and in this file write the following program:
    • In this program create 2 buttons as follows:
      • The first button when clicked invokes a function that displays an alert() box with a message saying "Welcome to Event Handling!"
      • The second button when clicked invokes a function that asks the user to enter their first name. Then display the message "Hi, first name " both on an alert box and on the page
      • Make sure the 2 buttons are separated and appear on their own lines.

Technical Requirements:

1. Upload the word document to Moodle (word doc with the link to this lab, screenshot of code, and the output).

2. JavaScript code is formatted properly.

3. Create a link to this file in default.html page.

4. This page has a link to home and to default.html




© 2025
Site maintained by Craig Knuckles, Ph. D
Professor of Mathematics and Computer Science