CSSE 120 -- Intro. to Software Development

Homework 13 (due at the beginning of Session 14)

  1. Complete the assigned reading for the next session: Zelle Chapter 10.1–10.5.
  2. Complete the Angel quiz over the reading assignment. You'll find the quiz on the course Angel page, under Lessons → Homework → Homework 13 → Defining Classes
  3. Finish the TicTacToe exercise that you began for the last homework. Commit your code to your SVN repository.
  4. Checkout Blackjack from your repository. (Blackjack will be available shortly after your class is done.) Add the following features to this code, and commit it back to your repository.
    1. Initially the program asks the user how many games to play.
    2. The program then takes the user through that many games. Do not get a new deck for each game, but continue to deal from the same deck. You may assume that the number of games is small enough so that the deck will not be exhausted. (I.e. your program does not have to check for an empty deck)
    3. At the end of each game, print the number of games won so far, the number lost, and the number remaining to be played.

    Suggestion:  You may want to rename your main() function to something like playOneGame().  Add to that function's code the ability to return information about who won that game. Then write a new main function that repeatedly calls playOneGame and keeps track of wins/losses. You will probably  need to move one line of code from playOneGame to your new main.  Can you see why?

    You may also wish to refer to this structure diagram of the BlackJack program.

  5. Web Link: Why all the spam references in CSSE120? Watch this video and find out the horrible truth.