Algorithms and OOD (CSC 207 2014S) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions] [GNU Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013F (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Overview
How do I test for an exception?
try
{
CodeThatShouldThrowAnException();
fail("Exception was not thrown");
}
catch (Exception e)
{
// Success!
}
Do we have to support PEMDAS (aka order-of-operations)?
No. I would not expect you to figure out the algorithm on your own.
If we find a way to support PEMDAS (say, on StackOverflow), will we get extra credit?
Maybe.
What operations should we support?
Addition, Subtraction, Multiplication, Division, Negation, Store in register
Can you explain the register/storage elements?
Kind of like the store/recall button, but textual
r0 = 2 * 3
r1 = r0 * r0
Do we have to support multiple assignments on one line, as in the following?
r0 = r1 = r2 = 2
No.
Do we have to worry about the calculator equals, which means print?
No. The = is just assignment. Print the value after each line
If you had to write a hash code for fractions, what would you do?
return this.num.hashCode * prime1 + this.denom.hashCode * prime2;
Why won't the following work?
obj = new Integer((obj.intValue())++);
It's similar to writing
5++. You increment variables, not values.
Some lessons from the Exceptions lab.
catch clauses are tried in order.Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions] [GNU Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013F (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Copyright (c) 2013-14 Samuel A. Rebelsky.

This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this
license, visit http://creativecommons.org/licenses/by/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.