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 #4

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 three 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: Taxbrackets (30 points)
[Collaboration not allowed]

Incomplete Draft Description. Create a TaxPayer class, with different rates for different income brackets.

Problem 2: Game of Nim Player (30 points)
[Collaboration not allowed]

Given code for game of Nim (Player and Pile), implement a new Player.takeTurn method where Player's strategy is: if one stick can be left in the pile by removing 1, 2, or 3 sticks, do so. Otherwise remove a single stick from the pile.

Problem 2: MazeWorld Energy Search. (40 points)
[Collaboration not allowed]

Incomplete Draft Description. Explorer searches among rooms, greedily going to highest energy one. (Give them a sample maze to play in.)