Posts Tagged ‘homework’

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: 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: HW 1

Wednesday, October 8th, 2008

The first two should be solveable immediately, but the last 3 will require some stuff from week 2, so you'll have to either read ahead, or wait until next week to started on them.

  1. Write a program that uses a series of outputs to display ASCII art. Be creative. Your program's output should be better looking than my "Face" program!
  2. Write a program that prints out a traces out a series of lines that explains how to calculate the following 5 geometric result: area of a rectangle, perimeter of a rectangle, area of a triangle, area of a circle (you can use Math.PI for pi!), and circumference of a circle. Trace out both an equation showing how it is calculated, and an example calculation, for each one.
  3. Generate three random numbers, for the following three variables: balance (Number), interestRate(Number), and minimumBalance (int).

    balance should be some number between 0 and 10,000.
    interestRate should be some number between 0 and 0.1
    minimumBalance should be some int multiple of 100, between 0 and 5,000

    If the balance is less than minimumBalance, charge the user a $100 fee.
    If the balance is at least twice the minimumBalance, double the interestRate.
    Apply the interest rate to the balance.

  4. Make a random number generator that simulates rolling 3 (6 sided) dice. Roll them once to determine your base number, and then print it out. Then roll them as many times as it takes to hit that base number again, printing out the total number of rolls. Also print out how many times you rolled higher than the base number, and how many times you rolled lower than your base number. NOTE: Matching your base number just means having the same total. I don't care what the actual dice show. A 12 is a 12.
  5. Let's make a dice check game. Rolling 3 6 sided dice again, let's roll until we have successfully rolled each possible result (3-18) at least once. Once this has happened, print out the total number of times each result showed up, as well as what percentage of the time each result showed up.
Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Fark
  • Google Buzz