Posts Tagged ‘Programming’

GAD225 HW5: Word Games

Monday, December 1st, 2008

For this project, present the user with the option to play any of the following three games:

1. Hangman, pick a word from your wordlist. Display it with dashes in place of the letters. Allow the user to guess letters (or the complete word as a separate option). Give them a finite amount of guesses. After it's over, allow them to play again with a new word, or go back to main menu.

2. Scramble, pick a word from your wordlist. Display it scrambled. Allow the user to guess the word. After it's over, allow them to play again with a new word, or go back to the main menu.

3. Mastermind. Generate a four digit number using only 1-6 for each digit. Allow the user to guess. Indicate how many numbers are correct, and how many are both correct AND in the right spot.

You can make additional combo options of the above for extra credit.

Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Fark
  • Google Buzz

GAD225 HW: Cards and Decks

Wednesday, November 19th, 2008

As discussed in class on Monday, you need to create a Card object from scratch, as well as a Deck object from scratch. I have provided you with a test class that you are not allowed to change. It can be found here.

Details on the Card and Deck requirements are found below. I've added 2 small things that we didn't discuss in class, so check it out.

(more…)

Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Fark
  • Google Buzz

GAD225: HW3

Sunday, November 9th, 2008

Due Week 7!

Grab CalendarTester. Fill in the missing functions. There is a pretty good order to fill them in to make your code work with other parts of your code most conveniently, so try and make that happen by reading through all the functions you need first, and figuring out where dependencies lie.

Additionally, in a separate file, Allow the user to enter a number (called n). This is the length of an array for you to create, filled with random numbers between 0 and 2n.

Make functions to do the following:

  • Find the biggest number in the array
  • Find the smallest number in the array
  • Reverse the order of the numbers
  • Find the total of all the numbers
  • Find the Average of all the numbers
  • Extra Credit:  Sort the array, without using the built in sort.
Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Fark
  • Google Buzz

GAD225: Midterm Study Guide

Tuesday, October 28th, 2008

Some key things to study:

  • Be comfortable writing loops.  Be able to look at an existing loop and know how many times it executes.  A good sample problem might be to take the stat generator from an earlier class, and make it loop to generate a specific number of stats.  Or loop until you get the roll you want.
  • Know random number generation.  The above sample problem would help with that too.
  • Be comfortable with the basic math and logic operators.  Know what each does, and their order of precedence.
  • Be able to use truth tables to dissect when a compound logic statement is true.  a && (b || !c) is true in what cases?
  • Be able to trouble shoot code for bugs.  Hopefully your homework has gotten you used to this, as there isn't much I can tell you to study directly.
  • Understand the way that functions work (including parameters and returning values), and be able to separate code out into a function.  CalendarTester will be useful for this.
Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Fark
  • Google Buzz