CS174 Fall 2006Practice Final

To study for the final would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes at least three times. Second and third time try to see how much you can remember from the first time. (3) Go over the homework problems. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) 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 final: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) It is comprehensive: There will be two problems from the material up to Midterm 1 (one of these will be from Practice Midterm 1); there will be two problems from the material up to Midterm 2 (one of these will be from Practice Midterm 2); the reamining six problems will be on material since Midterm 2 (one of these will be from the Practice Final).

[Student generated final solutions-PDF]

1. Explain with code how to do the following in JSP: (a) include one document in another, (b) set the content type for a page, (c) get the value of the POST'd form variable joe and print it to the output.

2. What is the JSP Expression Language? Give an example of using it in a JSTL tag.

3. Without using any PHP output statement like echo, print, etc. write an at most 300 character PHP program that outputs hello a 1000 times in paragraph tags.

4. Write a PHP program which sorts all the name value pairs from a form and prints then each of these pairs out in ascending order.

5. Explain with code how you could maintain using sessions a data for shopping cart in PHP.

6. Briefly describe the bread crumb design pattern.

7. Write a short PHP program which counts the number of times an individual comes to a site using file I/O.

8. Do problem 7 in PHP but this time persistently store any of the data in a mysql database.

9. Do problem 8 but this time using JSP.

10. Do problem 8 but this time using Perl.