Monday, June 23, 2008

Add some points to your previous test

For every programming exercise you do from chapter 6-10 you can get 3 points on your test for a maximum of 9.

Email me and upload it to the FTP server. Deadline next Monday June 30, 2008.

Email me for your grades.

Wednesday, June 18, 2008

A BlackJack program designed by you and a partner

Major Assignment 3
Next major project Due Friday 6/27/08 by the start of class: Design a BlackJack program with another student! Send me a note with who you are working with (or if you choose to work alone).

Use a class Card that randomly assigns the card as either a 2-10 or a Jack, Queen, King, or Ace. Methods should be public int returnValue()will return the int value of a card. You may assume an Ace is an 11 but extra credit (+5) is available if you determine whether it should be a 1 or an 11!

public String returnTypeOfCard() will return the full name of the card.

class BlackJack is where things get interesting...how are you going to represent the game?
What methods are needed to check the sum? What other methods are needed? If the user asks to stop hitting, will the computer dealer want to hit again (Hint, under 17 he will!). Just ignore the suits for now.

It must be done in an object oriented fashion (this is Java, not C). Use arrays of Cards in class BlackJack.

class BlackJackTester() will play the game until the user gives up!

Due Wednesday before 6:00 pm.

Upload it your FTP space.
I'd like both members of the group to upload the .class and .java files to their FTP space.

ftp://davidcfreer.com

Fun little diversion

Check out this cool game written in Java. It can be challenging!

Today's minor assignment

Create a program with a Person class where the user enters in an ArrayList with 5 Persons. A Person is considered to have a name and an age.

Input: 5 Names, 5 ages

Output: The 5 Person objects (names and ages).

Comment each line of your program, explaining what each line is doing!

Upload to FTP space at end of class.

Monday, June 16, 2008

In your own words to define...

Interface, abstract class and inner class.

Pick one; find formula on Internet; do it with Java (static method)

//public static double sphereVolume(double r)

//public static double cylinderSurface(double r, double h)

//public static double coneVolume(double r, double h)

!!!