CS222 Web Programming Assignment 5

Trish Cornez

Part I

Write your answers in an MS Word document and upload to Moodle.
  1. What is a "cookie", how is it stored, and how is it used?
  2. Do "cookies" have expirations?
  3. What particular field does a server use in its HTTP response to put a cokie on the browser computer?
  4. Consider that a user has cleaned up all their cookies on their browser. Then they visit a site, such as United Airlines. What cookies would they see on their browser?

Part II

Create a web app that allows a user to play the well-known game called Monty Hall Game. Use the images and the outline below to guide you in constructing this game. Write your game code in JavaScript.
  1. To play the game, the user is presented with three closed doors. Behind one of the doors is a car prize. The goal of the game is for the user to guess the correct by providing two answers. The user is first prompted for an initial door selection.

  2. Once the user has supplied their initial door guess, the game engine should eliminate one of the doors. It is important to eliminate a door that does not contain the car and is not the user's initial guess. The game engine can now prompt the user to either stay with their initial guess or change doors. Display an alert if the user attempts to select a removed door.

  3. The game ends when the player wins the car or loses the car, as shown below.
    Allow the user to start over with a new game by clicking any one of the doors.

  4. There is no need to spend much time on images. You may use the images here or locate images to use online.
  5. Upload a working game to your website and make sure it functions properly in Chrome.