Assignments

Project 1
Answer all of the questions from last semester's Final Exam.  Submit your handwritten answers on the date shown on the calendar. 

Project 2
Complete problem 7.39 (Both editions).  Your application MUST contain a recursive function to receive credit.

Project 3
Create a Vending Machine application that displays images for four snacks and corresponding Labels that indicate numbers for each snack (the snacks should be numbered 0-3).  Use a string array that contains the names of each snack.  The GUI should contain a TextBox in which the user specifies the number of the desired snack.  When the Dispense Snack Button is clicked, the name of the selected snack (retrieved from the array) should be displayed.  If the user enters a snack value not in the range 0-3, an IndexOutOfRangeException will occur.  Use exception handling so that whenever an IndexOutOfRangeException occurs, a MessageBox is displayed indicated the proper range of values.  Also handle any possible FormatExceptions that may occur.  You may download images of your choice, or if access images from the disk if you have the 2nd edition of the text.  Your interface should look as follows:

 


Project 4
Create a Console Hangman Game.  DO NOT SUBMIT A GUI APPLICATION FOR THIS ASSIGNMENT. 

Using your knowledge of strings and arrays, your game should AT A MINIMUM, include the following functionality.  Extra credit will be considered for additional features.

  1. Create an array of game words that contains the following:

    "CLAYTON", "INFORMATION", "TECHNOLOGY", "PROGRAMMING", "CIMS", "OBJECTS", "CLASSES", "ARRAYS", "RECURSION", "STRINGS"
     

  2. Using the following code to create a random number, select a random word from the array.

        Random r = new Random();

        int secret_number = r.Next(0, 9);

  1. Your user should get 6 guesses (no drawing is required).
  2. Display the "secret word" as a series of asterisks.
  3. If your user chooses a letter that is in the game word, indicate how the word has changed. If the letter is not in the word, indicate this and the number of tries is reduced by one.
  4. Be sure to keep track of letters that are guessed and display letters that are still available.  If a user guesses a letter that has been guessed before, indicate this to the user.
  5. The game will continue until the user has guessed all of the letters in the game word, or has run out of tries.
  6. Be sure and ask your user if he wants to play again!
     

Your interface should look similar to the following:

 

 


EXTRA CREDIT PROJECT
Follow the directions on this page.


Project 5
Complete problem 18.3 (19.3 in the 3rd Edition) of the Dietel text.