Web Technologies I – Final Exam
Write your answers on the answer sheets provided. You may refer to printouts of your source code from homework #11. You may also make use of the HTML and CSS quick reference guides distributed in class as well as the Javascript command sheets (without commentary).

  1. (2 pts) What organization gives domain name registrars authority to sell domains?

  2. Suppose you and a friend overhear someone say “I just purchased the domain name `frogs.com' for $2,300.” Your friend, knowing you to be a web guru, asks the following questions:
    1. (2 pts) Do all domains cost the same amount? If not, why is that one so expensive?
    2. (2 pts) Is a domain purchase for a lifetime? If not, how long do they get to keep it, and what happens when that time period expires?

  3. Consider the following URL: http://walmart.onsale.com/bargains
    1. (2 pts) Which part is the domain name?
    2. (2 pts) Which part is the protocol?
    3. (2 pts) Which part is the server name (or subdomain)?
    4. (2 pts) Does this web page belong to Walmart? Explain.

  4. (2 pts) Name one example of a CMS.

  5. Suppose you want to have a "bubble-breaker" kind of game where the user will click on styled buttons that have numbers on them. Write your solutions to these problems using Javascript.
    1. (10 pts) Write code that when the user clicks on a button the button will disappear and the number that was on the button will be added to the user's total (which is stored in a span tag whose id is “total-score”). Assume the span tag initially contains the value 0 and that every button that can earn points has a class called “one-use”.
    2. (4 pts) Suppose there is a button with an id of “save-button” that when clicked will cause the current score to be saved into localStorage under the name “bubblescore”. Write code that will implement this action.
    3. (8 pts) Write a section of code that will wait until the page has been loaded and then will check to see if a score is stored in localStorage. If no score exists it should create a score of 0 in localStorage and then put a score of 0 in the span tag. If the score exists it should read the score and put that value in the span tag.

  6. Assume you are given the following code as a starting point: exam_solutions/2023.final_start.html Your task is to add the necessary CSS and Javascript code to produce a simple Disc Golf Score Card. Some restrictions:
    • Don't add any id's or classes to existing elements. Use appropriate selectors based on what you are given.
    • Don't modify or add any HTML code unless specifically asked to do so.
    • Don't utilize any external documents. Assume all your Javascript goes on the page at the indicated position (at the bottom of the page). Also assume that all your CSS code goes at the top of the page in the indicated position.

    This page represents a score card for a 9-hole disc golf course. The provided code shows the first and last holes. Assume there are 7 more holes where the dots appear in the code.

    1. (2 pts) Write the HTML command you would add in the head of the document to instruct the browser to properly scale content for small-screen devices?

    2. Write CSS commands to accomplish the following:
      1. (4 pts) Write commands so that all elements will use the border-box box sizing model.
      2. (6 pts) Write commands needed to use flexbox to put the two main divs side-by-side with each taking up half the available space.
      3. (4 pts) Write a media query that will cause the two main divs (with ids listofholes and results) to be full-width and stacked on top of each other when the screen size is 700px or below.
      4. (6 pts) Write commands to style each section containing the input boxes for the holes. Each section should have a light grey background, a 10 pixel bottom margin and 5 pixels of padding right, bottom, and left.
      5. (4 pts) The error message with an id of “hole-error” should be styled to be initially hidden and should be given a red color.

    3. Write Javascript commands to accomplish the following:
      1. (6 pts) When the button labeled “Clear Card” is clicked all the input boxes should be emptied to prepare for a new game.
      2. (16 points as indicated) When the “Done!” button is clicked (2 pts) we need to check all the input boxes and make sure that they contain valid numbers.(4 pts) A number is valid if it is an integer in the range 1 to 50. If any of the numbers is not valid we reveal the error message (2 pts). Otherwise we add up all the numbers in the text boxes (2 pts) and put the total in the span tag beside the appropriate label (3 pts). In the second span we will provide a text response indicating the player's level (3 pts). We say “Pro” if their total score is at or below par for professionals (27). We say “amateur” if their total score is above professional level but at or below par for amateurs (36). Otherwise we say “Loser”.