CIM7B Assignments:

 

Class will have up to 7-15 on-line programming assignments, labeled P1-P15. Each assignment is worth 10 points, pay attention to due dates on assignment you may hand in assignments past the due date for 1/2 credit. During class discussion students should create an outline, algorithm or set of notes for solving program. For students who miss homework assignments, I will require you to hand in these notes with the programming assignment. Your assignments can be checked one of two ways:

  1. E-mail them to me but make sure your e-mail subject header has CIM7B P1..P10, where P1..P10 represents the assignment you are sending me.
  2. Bring printed copies to class.

First Method is preferred.


  Assignment
Due Date
0 Fill In Student Questionnaire and E-mail it to me. If you use lab computer make sure you delete your original file.
1/24/05

Chapter 1-7 Review

 

 

Install Java and your choice of IDE at home

Since Java 2 SDK 1.5 (J2SE5) is a significant upgrade over Java 2 SDK 1.4 you should try to go with J2SE5, however, I was unable to get Netbeans 4.0 to work reliably on my computer, as a result in lab, we will be sticking with Netbeans 3.6, however, at both home and in the lab I loaded Java2SE5, and moved the link from Java 2 SDK 1.4 to Java 2 SDK 1.5, therefore netbeans and textpad are both using the latest Java. I recommended you do the same at home. If you are interested in using netbeans 4.0, and have previously used 3.6 here is a good upgrade tutorial.

Home page index useful links has links to software you need to install.

 
P1

Chapters 1-6 Review
Loop Control, Arrays, String and Primitive type Review.

Write class count, program has two constructors:

(1) default constructors set the output type to arabic
(2) constructor with one string argument either "arabic", "roman" or "english"

program has three counting methods:

(1) myForCount , (2)myWhileCount, (3)myDoWhileCount,

each method counts from 1 to N (where N can be between 1 and 10).
Each method will use the respective, for, while and do while loop.

Output of the program can be in one of three formats: Arabic 1..10, roman I..X, or English text one..ten. Type of format will be determined by value of the instance variable set by constructor during instantiation time. Hint all you need to do is setup up one 2-dimensional array of type string (i.e., String[][] output).

2/7/05

  make your TicTacToe Game an Applet - Applet Tutorial Maybe Assigned Later
P2

Inheritance Review

Write a vehicle base class with two instance variables: number of wheels and number passengers

Write a derived automobile class that inherits base class vehicle and adds to more instance variables: number of cylinders, and gas mileage.

Pick your favorite car and write a new derived class based on automobile class, your favorite car class should add two more instance variables. In addition, your favorite car class should have one static string or method which returns the name of the car.

All three classes should have:

(1) Two constructors a default and one that sets all underlying instance variables
For example, second vehicle constructor has two arguments. but second automobile constructor has four arguments, two to set automobile instance variables, and a super call to vehicle to set its two instance variables.
(2) A writeOutput method that writes out the instance variables with descriptions, note you may want to use super to call base class methods.
(3) Two accessors and two mutators for setting and getting instance variables

2/11/05
Chapter 8
  sourceforge product of the month is RSSOwl a Java base RSS system.  
P3

Exception Handling, Programming Exercise 4 page 538

Convert dates from Numeric format to alpha-numeric format,

Throws two exceptions

3/27/05

 


TicTacToe

API | Source Code
This Assignment has a possible 50/10 points.

P4

10 Points for Completing these tasks:

  • Write intToBoard
  • What purpose does the variable myDebug Serve?
  • Three Methods Don't have any Code find them
  • and Write the code
  • Email me just the solutions (not all the code)
2/24/05
EC4

+10 Points write a PlayerHuman, code for a human player. Only the PlayerHuman class needs to be written; a PlayerJSP is difficult, refer to API for methods on creating a PlayerJSP.

Points Official Performance Rating*
+10 0 Write a Computer Player
+10 6 Write a Better Computer Player
+10 8.5Write an awesome Computer Player

*Must be against playerRandom, with at least 20,000 games

Automatic A if You can Write a Player that Defeats PlayerAce

3/10/05
 

Chapter 9

P5 Programming Exercise 1 page 608 Do Only the Text File Version, but don't write output to the screen, instead write it to a file
4/12/05

Chapter 10

P6 Modified Programing Exercise 3 Page 665; read a list of PetRecords into a vector, sort by name, they write output to screen. Modification read the list from a file and not from the keyboard.
5/4/05
P6 Programming Exercise 6 page 666 - may not cover this part of the chapter  

 

Chapter 12

 

P7 Programming Exercise 1 Pae 791
5/11/05
P8 Programming Exercise 2 page 791
5/11/05

 

Chapter 13

 

P9 Programming Exercise 3 Page 820  

 

Chapter 14

P10 Programming Excercise 1 Page 890  
     
 
Battleship - Term Project
 

Write a Battleship Player, put ships in Corner, just guess randomly.

What is the sequence of message that gets sent to your player when you call:

    1. debugMode()
    2. singleUserTestMode();
    3. headToHead();
    4. tournamentMode();
on TournamentMode you need an array of players, but you can use the same player more than once
Hint 1 - may be done as in class assignment
 

Write your own Battleship player - Implement the method makeMove & placeShips in your PlayerN class, where N is the number you have selected on the signup sheet. You will need to implement messages relative 'Single User Test Mode' and 'Head to Head Combat' Extra Credit: (1) Find Bugs in Battleship Code; (2) Devise significant battleship upgrades; (3) Check with me about adding upgrade on your own (4) Your player exceeds 'Single User Test Mode' 6.0 performance rating.

 
 

In tournament mode, after Head to Head combat is completed, your player will be passed a message IDSeriesRating, this messages signifies that the SeriesRating class is completed. Use SeriesRating.getHead() to get the head pointer of this class, step through the link list, and write your own statistics to disk. You should be creating the private method fileStat. Why is this method private? Keep in mind that PrintSuperClass allows easy file writing. Extra Credit: Come in with a competive player. Able to defeat, Palomar Hall of Framer (14-15 Year Old or First Student to Defeat Me), be a top class player or defeat my pride and joy AceInTheHole; Extra Credit: (1) Find Bugs in Battleship Code; (2) Devise significant battleship upgrades; (3) Check with me about adding upgrade on your own

 
  Using the head pointer to SeriesRating.getHead(), write a recursive routine that steps thru each link node in the list. Your program should read the number of win vs losses for the series. Using PlayerSkill statistics (methods) you should be able to determine, if the win loss of the series correctly represents the players capabilities. For this assignment you can also use the battleship code to read the files PerformanceRating.dat and SeriesRating.dat, these two files represents statistics from the tournament mode on our web-site, you don't need to write a player of makeMove to read these files, simply use bpi to determine how to read these files. After you have written a program for interface to the battleship class, write a short synposis on any unusually findings in the last tournament mode.  
  Write a frame interface for Battleship, either for DebugMode or Tournament