Chris Pollett> Old Classses >
CS174

( Print View )

Student Corner:
[Final Exam-PDF]

[Submit Sec1]
[Grades Sec1]

[Lecture Notes]
[Discussion Board]

Course Info:
[Texts & Links]
[Description]
[Course Outcomes]
[Outcomes Matrix]
[Course Schedule]
[Grading]
[Requirements/HW/Quizzes]
[Class Protocols]
[Exam Info]
[Regrades]
[University Policies]
[Announcements]

HW Assignments:
[Hw1] [Hw2] [Hw3]
[Hw4] [Hw5] [Quizzes]

Practice Exams:
[Midterm] [Final]

CS174 Fall 2020Practice Midterm 1

For the midterm I would suggest you:

  • Know how to do (by heart) all the practice problems.
  • Go over your notes at least three times. Second and third time try to see how much you can remember from the first time.
  • Go over the homework problems.
  • Try to create your own problems similar to the ones I have given and solve them.
  • If you want to study in groups, at this point you are ready to quiz each other.

The practice midterm is below. Here are some facts about the actual midterm:

  1. It is open book, open notes, open internet, however, you are not allowed to discuss problems on the midterm with classmates or other people until after the midterm submission period is over.
  2. It will be posted by the start of class time on the midterm day as one of the links on the side of the class homepage.
  3. You submit the midterm for grading using the same mechanism as to submit homeworks.
  4. It is designed to take an 1h15m, however, you can submit it up until midnight on the day it is posted.
  5. Some problems will be dependent on some personal information about you such as your ID, and you will not receive credit if you don't make use of this information correctly.
  6. One problem will be off the practice midterm.

Practice Problems

On practice midterm day, please post your problem solutions to the Practice Midterm Thread.

  1. Suppose we have a DNS server whose IP address contains the last three digits of your studentID. Explain the internet messages (including DNS) involved in an HTTP/1.1 request for the /index.html homepage of a site whose fully qualified domain name contains your first name.
  2. Write a short, validating HTML 5 document titled "Birthday Invitation" with an h1 header, paragraph, and a unordered list inviting someone to a birthday. The details should be specific to your actual birthday.
  3. Give the XHTML 5 necessary to output an accessible form with a dropdown that lets users select the month of the year. Give the css to style any label for this tag so it appears in a 24pt font.
  4. Briefly explain the box model used in rendering HTML elements, labeling its parts. Give stylings for each of these parts for a div tag where the sizes of the parts make use of the last digits of your student ID.
  5. Write a short PHP program count.php which outputs a webpage with title your name followed by a counter. An h1 header on the page should have the same text. Beneath this there should be a number containing a count of the number of visits to the site by anyone. The counter should be implemented in PHP by storing the count number in a file count.txt in the same folder as count.php.
  6. Write a PHP program that (a) checks if the request had a variable rows with value some integer, and if so, calls a function drawCubesTable with this value. (b) drawCubesTable($num) draws an WAI accessible table that has two columns with heading `n` and `n^3`. (c) drawCubesTable($num) then draws under these headings $num rows: 1, 1; 2,8; 3, 27; ... , (d) if the row's request variable is not set, your program should say "To see a tables add a query string containing a rows variable" and then exit.
  7. Give an example of a HTML document which makes use of four different levels of cascading styles. Your example should show how one level of style overrides another. It should somewhere make use of !important to show that it is possible to prevent styles from being overriden.
  8. Give the HTTP header messages that would need to be sent by a server to set a cookie with name your last name and with value your student ID. Explain how cookies can be used to implement sessions.
  9. Explain the mediating-controller MVC design pattern and give an example of code for each of its components.
  10. Briefly explain the Post-Redirect-Get pattern and give an example that makes use of a post request where one of the field's values contains your name.