CMPSCI 121
"Introduction to Problem Solving with Computers" using Java

Department of Computer Science
University of Massachusetts Amherst

Home
Resources
Grading
Weekly Schedule
Syllabus
Homework
Exams

Bulletin Board
Staff

Programming Assignment #3

Due in OWL, 9:00am, Tuesday February 22, 2005.
Extra credit of 5 points if handed in before 11:59pm, Monday February 21, 2005.

Important notes:

  • This programming assignment contains two problems, and can earn a total of 100 points as described below.
  • Extra credit described below accumulates points into an overall extra credit count that may be used at the end of the semester to determine letter grade border cases at the end of the semester.
  • File, class and method names should be exactly as described below. You may, however, if needed add additional helper variables and methods.
  • Each method's return type, as well as the number, order, and types of parameters must be as specified. Parameter names don't have to be the same.

Problem 1: A Receipt Class (30 points)
[Collaboration not allowed]

Incomplete Draft Description. Static Variables and Methods: Create a Receipt class: similar to Ticket class from lecture, but each receipt immutable amount. Class has Receipt.getTotalAmount(). Each Receipt has a unique int id. Also implement Receipt.getNumberOfReceipts().

Problem 2: MazeWorld. (70 points)
[Collaboration not allowed]

Incomplete Draft Description. An adventure game: Explorer, Denizen, Room. Given skeleton for Explorer class, fill it in. give Explorer and Denizen classes a default strength and tolerance.. and create an additional constructor that uses them. Create toString methods for all objects. Implement Room and Explorer move() method. Extra credit 5 points: implement backtrack() method that, remembering past room, returns to it.