Chris Pollett> Old Classses >
CS174

( Print View )

Student Corner:
[Final-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 Spring 2021 Practice Midterm

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. Briefly state how the following protocols are used by your browser to retrieve a web page: (a) DNS, (b) TCP, (c) HTTP.
  2. Give an example HTTP/1.1 HEAD request message that might be used for the url http://www.cs.sjsu.edu/faculty/pollett/174.1.21s/PracMid1.html. Give an example successful HTTP Response message.
  3. Write a complete XHTML 5 document inviting people to a party in the town where you were born. The document should have a link tag for a style sheet and meta tag that indicates robots should not index the page. It should also make constructive use of an h1 tag and an unordered list.
  4. Explain the difference between data tables and layout tables. Give an HTML example of an accessible data table where the data items involve the last four digits of your student ID.
  5. Explain with example code and drawing of how it would be rendered, the following css property values: (a) display:inline-block, (b) position: fixed, (c) p:hover { visibility:hidden}.
  6. Explain the difference between PHP interpretive and copy mode and how to switch between them. Describe at a high level what is going on in the PHP processor when you switch into copy mode in the middle of a function definition.
  7. Write a PHP program days.php that when no request data has been sent outputs an XHTML 5 page with a form that uses method GET and no action consisting of a dropdown with options 1 through how many days old you are and a submit button. When submitted, the form should print the date selected in the format d-m-Y using the PHP date function.
  8. Explain (a) how HTTP cookies are set and retrieved, (b) how sessions are implemented with cookies, (c) how to use PHP's $_SESSION superglobal and what is happening behind the scenes with regards to cookies and files.
  9. Briefly explain and give an example use of the following design patterns: (a) mediating Model View Controller, (b) Post Redirect Get.
  10. Write a PHP class with method drawFooTable which makes a connection to a Mysql database Goo running on localhost on the default port. It then retrieves all rows and columns from the Foo table and prints then to an XHTML page.