# Class 30: Discussion of Exam 1

Back to Class Cancelled. On to Priority Queues.

Held: Tuesday, March 14, 2006

Summary: Today we discuss some issues that pertain to exam 1.

Related Pages:

Assignments

Notes:

• I understand that there was some frustration about Friday's lab. I apologize. It was intentional that the difficulty in `get` related to an error in `put`.

Overview:

• General notes.
• String edits.
• Creating fractions.
• Comparing points.
• Piggybanks.

## General Notes

• "n.p." means "no penalty"
• Not all of you took advantage of available extra credit.
• Not all of you took advantage of the grade for effort.
• I care about capitalization (but did not take off, this time).
• Fields, variables, methods: Begin with a lowercase letter.
• Classes: Begin with uppercase letter, mixed case.
• Constants: All caps.
• Packages: All lowercase.
• I care about indentation.
• Extra work can lead to penalties as well as extra credit.
• Don't print error messages; throw exceptions.

## Problem 4: String Comparisons

• Some of you made this more difficult than it should have been.
• I tried to give you a straightforward algorithm to translate into code.
• Part of the issue was discovery: How expensive is this algorithm?

## Problem 1: From double to Fraction

• Conceptually complicated for some: To build one fraction, you need to build others.
• Possible to do without that conceptual complication, but more difficult.
• Some issues with rounding up and rounding down (particularly with negative numbers).

## Problem 2: Vector Equality

• Most of the necessary utility code was in the reading on classes.
• Many of you got the wrong metric.
• Is it a good metric? Why or why not?

## Problem 3: A Piggybank

• Generally fine.

Back to Class Cancelled. On to Priority Queues.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Tue May 9 08:31:43 2006.
The source to the document was last modified on Thu Jan 12 14:58:06 2006.
This document may be found at `http://www.cs.grinnell.edu/~rebelsky/Courses/CS152/2006S/Outlines/outline.30.html`.

You may wish to validate this document's HTML ; ; Check with Bobby

Samuel A. Rebelsky, rebelsky@grinnell.edu