Anda di halaman 1dari 1

CS/CE 2336 Computer Science II (Advanced Java Programming), Summer 2012

Assignment 3
Due at 11:59pm, Friday 29th- 100pts
Directions: Implement a class or classes which contain the following:
Part 1: Implement a recursive algorithm which solves the Towers of Hanoi problem. This program
should take as input from the user the number of disks to be sorted. It should output the steps of the
algorithm displayed in a manner similar to the following:
Start:7disksareonpoleA
Step1:disk1ismovedfrompoleAtopoleC
Step2:
Finish:7disksareonpoleB
Part 2: Implement a graph in the following manner: graph G is a digraph defined by G = (V, E),
where V is the set of vertices in the graph, and E is the ordered set of edges defining G. The sets V
and E are contained in a file called graph_input.dat. This file contains text only. You are to read in
the contents of this file, and using Generics create an ArrayList containing all the elements of the set
V cast as GeometricObjects. The set E should also be stored in an ArrayList using Generics, in
whatever format you choose. You will parse/filter the Arraylist for V, cast every fourth element
(beginning with element 0 (the first one)) as a circle (using Generics), and then store them in another
ArrayList defined by a Generic type of Circle. Finally, using V and E, you will output to a file
called graph_output.txt the adjacency list, adjacency matrix, and incident matrix for G in text
format.
Requirements: Programming assignments should be submitted using your eLearning account. Each
programming assignment must contain the following:
1. A text copy of all source code including its documentation (.java)
2. A file showing test cases for your programs input and displayed output (.doc)
3. Copies of all Java executable code (.class) files needed to execute the program.
4. All files (.java, .class, .jar, .doc, etc.) should be submitted in a single .zip file.
Grading: Programming assignments will be graded according to the following metrics:
Code Development - 30% (compile w/o error)
Program Execution - 20% (run successfully)
Program Design - 25% (conform to spec)
Documentation - 15% (program, comments) see below
Coding Style - 10% (clear, efficient)
1

Anda mungkin juga menyukai