Return to site

Blackjack Programming Assignment

broken image


By using the BlueJ environment, even programming novices are able to develop, over the course of four assignments, a working implementation of the card game Blackjack. Because the concepts are presented in the context of a fun and familiar application, the assignment.

Assignment
  1. Readability - Is your program consistently indented in a manner that reflects the structure of your code? Is it easy to read? Are there blank lines which break up the major sections of your code? (5%) Welcome to Mitchell's blackjack program! You get a 6 and a 5. Your total is 11. The dealer has a 7 showing, and a hidden card.
  2. $begingroup$ @RubberDuck, there are single deck Blackjack games still being played in Deadwood,SD at Saloon #10 I think it might be the only single deck game in Deadwood. (Last Time I was there to Play Blackjack) $endgroup$ – Malachi ♦ Aug 21 '14 at 15:09.
  3. Blackjack 1 The game For this assignment, we will be writing a program to play (a somewhat limited version of) the game of Blackjack (a.k.a., 21). Specifically, this version of the game will pit a single player (the user) against the dealer (the machine). Here is a description of our simplified version of Blackjack.
  4. Learn how to build a command line game in Python for playing Blackjack.

Blackjack ( Due 19 Feb 2017 )

In this program you will use the following classes - Card, Deck, Player, Dealer, and Blackjack. The intent of this assignment is for you to simulate a Blackjack game using classes and object-oriented programming similar to your last programmingassignment. This program will introduce the concept ofinheritance.

In Blackjack you want to have a hand value that is closer to 21 thanthat of the dealer, without going over 21. You are playing strictlyagainst the dealer and not against the other players at the table. Thevalues of the cards are as follows:

  • An Ace can count either as 1 or 11 to make the best hand.
  • Cards from 2 through 10 are valued at their face value.
  • Jack, Queen, and King are all valued at 10.
  • All suits have the same value.
The value of a hand is simply the sum of the point counts of each card.If the first two cards in your hand is (Ace, 8) and stop there, then Ace will count as 11 and your hand is worth 19 points. If, on the otherhand, you get another card and it is another 8, you now have (Ace, 8, 8)and in this case Ace is 1 and your hand is worth 17 points.

The dealer deals two cards to all the players including himself. Theplayers' cards are dealt face up. Only one of the cards of the dealeris face up and the other is face down.

Once the cards are dealt, each player in turn indicates to the dealerhow he wishes to play his hand. After each player has finished, thedealer will complete his hand. In a casino the dealer will either pay or collect the players' bets. In your program you will write out whether the players won or lost or tied with the dealer.

Blackjack

The dealer has no choice in how he plays his hand. He must continue totake cards ('hit') until his total is 17 or greater. An Ace in thedealer's hand is always counted as 11 if possible without the dealergoing over 21. So if the dealer has (Ace, 9), then his total will be20 and he stops drawing cards ('stand'). However, if the dealer had(5, 7) and then added an Ace and his hand was (5, 7, Ace) then thetotal is 13 and so he hits again. Supposing he now he draws a 5, thenis hand (5, 7, Ace, 5) totals 18 and he stands.

In the case of the player we have simplified the options that he has.The player can either hit or stand. Doubling or splitting pairs arenot options that you will simulate in your program.

Your program will allow anywhere between 1 and 6 players (inclusive).Here is what your output will look like:

Here are some special cases to consider. If the Dealer goes over 21,all players who are still standing win. But the players that are notstanding have already lost. If the Dealer does not go over 21 butstands on say 19 points then all players having points greater than19 win. All players having points less than 19 lose. All playershaving points equal to 19 tie. This last case we made up to simplifyyour programming.

This is a template of the code. Thecode is not complete and it was written in part for a single player. Iwould like you to make modifications to the code so that it followsthe specifications.

The file that you will be submitting will be called Blackjack.py. We will belooking for good documentation, descriptive variable names, clean logicalstructure, and adherence to the coding conventions discussed in class.You may work with a partner on this assignment. Both of you must read thepaper on Pair Programming andabide by the ground rules as stated in that paper. The file will have a header of the following form:There will be only one copy of the file being submitted if you are doing pair programming.

Use the Canvas system to submit your Blackjack.py file. We should receive your work by 11 PM on Sunday, 19 Feb 2017. There will be substantial penalties if you do not adhere to the guidelines. Remember Python is case sensitive. The name of your file must match exactly what we have specified.

  • Your Python program should have the proper header.
  • Your code must run on the command line before submission.
  • You should be submitting your file through the web based Canvas program. We will not accept files e-mailed to us.
  • Here is the Grading Criteria.

Blackjack Programming Assignment Examples

  • Stelly's

    • Teachers

      • BARCHEN, Trevor

      • BARTLETT, Alicia

      • BERGER, Dan

      • BERGSMA, Andra

      • BISHOP, Jeffrey

        • Archived Courses

      • BOSMAN, Sonje

      • BRAUN, Ryan

      • BROWN, Taryn

      • COLLINS, Mike

      • CUNNINGHAM, Michelle

      • DILDY, Jessi

      • DOUGLAS, Luke

      • FITZGERALD, Naomi

      • GILLESPIE, AL

      • GLUBE, Stephanie

      • GORDON, Scott

      • HART, Brad

      • HEINEKEY, Douglas

      • HEYWOOD, Peter

      • HILTON, Maria

      • HOFFMAN, Amanda

      • JULIEN, Matthew

      • KEDVES, Alice

      • KOENIG, Kim

      • LAMPARD, Aimee

      • LARSEN, Garret

        • Student Services

      • LEVESQUE, Gwen

      • LIBERATORE, Tasha

      • LIZAMA, Isabel

      • LOCKHART, Tim

      • MANNING, Maureen

      • MATHESON, Sarah

      • McDONALD, Chris

          • Participants

          • General

          • Computer Science 11 (Visual Basic)

          • AP Computer Science (Java)

          • Computer Programming 11/12 Spring 2020 – Mr. McDo..

      • MCNAMEE, Lara

      • MONTGOMERY, Lynn

      • RYALL, Linda

      • SCHOFIELD, Eric

      • SIDHU, Asha

      • SIEBERT, Jon

      • STRUTYNSKI, Stephen

      • TAMBOLINE, Camille

      • TISSARI, Timo

      • VOPNFJORD, Char

Slot tech magazine interesting stuff for men

  • WALLACE, Catherine

  • WHEELDON, Roy

  • ZIEGLER, Norbert

  • Home

  • About

  • Students

  • Parents

  • Staff

  • Resources

  • Programs

  • Boulders

  • Casino
    1. Readability - Is your program consistently indented in a manner that reflects the structure of your code? Is it easy to read? Are there blank lines which break up the major sections of your code? (5%) Welcome to Mitchell's blackjack program! You get a 6 and a 5. Your total is 11. The dealer has a 7 showing, and a hidden card.
    2. $begingroup$ @RubberDuck, there are single deck Blackjack games still being played in Deadwood,SD at Saloon #10 I think it might be the only single deck game in Deadwood. (Last Time I was there to Play Blackjack) $endgroup$ – Malachi ♦ Aug 21 '14 at 15:09.
    3. Blackjack 1 The game For this assignment, we will be writing a program to play (a somewhat limited version of) the game of Blackjack (a.k.a., 21). Specifically, this version of the game will pit a single player (the user) against the dealer (the machine). Here is a description of our simplified version of Blackjack.
    4. Learn how to build a command line game in Python for playing Blackjack.

    Blackjack ( Due 19 Feb 2017 )

    In this program you will use the following classes - Card, Deck, Player, Dealer, and Blackjack. The intent of this assignment is for you to simulate a Blackjack game using classes and object-oriented programming similar to your last programmingassignment. This program will introduce the concept ofinheritance.

    In Blackjack you want to have a hand value that is closer to 21 thanthat of the dealer, without going over 21. You are playing strictlyagainst the dealer and not against the other players at the table. Thevalues of the cards are as follows:

    • An Ace can count either as 1 or 11 to make the best hand.
    • Cards from 2 through 10 are valued at their face value.
    • Jack, Queen, and King are all valued at 10.
    • All suits have the same value.
    The value of a hand is simply the sum of the point counts of each card.If the first two cards in your hand is (Ace, 8) and stop there, then Ace will count as 11 and your hand is worth 19 points. If, on the otherhand, you get another card and it is another 8, you now have (Ace, 8, 8)and in this case Ace is 1 and your hand is worth 17 points.

    The dealer deals two cards to all the players including himself. Theplayers' cards are dealt face up. Only one of the cards of the dealeris face up and the other is face down.

    Once the cards are dealt, each player in turn indicates to the dealerhow he wishes to play his hand. After each player has finished, thedealer will complete his hand. In a casino the dealer will either pay or collect the players' bets. In your program you will write out whether the players won or lost or tied with the dealer.

    The dealer has no choice in how he plays his hand. He must continue totake cards ('hit') until his total is 17 or greater. An Ace in thedealer's hand is always counted as 11 if possible without the dealergoing over 21. So if the dealer has (Ace, 9), then his total will be20 and he stops drawing cards ('stand'). However, if the dealer had(5, 7) and then added an Ace and his hand was (5, 7, Ace) then thetotal is 13 and so he hits again. Supposing he now he draws a 5, thenis hand (5, 7, Ace, 5) totals 18 and he stands.

    In the case of the player we have simplified the options that he has.The player can either hit or stand. Doubling or splitting pairs arenot options that you will simulate in your program.

    Your program will allow anywhere between 1 and 6 players (inclusive).Here is what your output will look like:

    Here are some special cases to consider. If the Dealer goes over 21,all players who are still standing win. But the players that are notstanding have already lost. If the Dealer does not go over 21 butstands on say 19 points then all players having points greater than19 win. All players having points less than 19 lose. All playershaving points equal to 19 tie. This last case we made up to simplifyyour programming.

    This is a template of the code. Thecode is not complete and it was written in part for a single player. Iwould like you to make modifications to the code so that it followsthe specifications.

    The file that you will be submitting will be called Blackjack.py. We will belooking for good documentation, descriptive variable names, clean logicalstructure, and adherence to the coding conventions discussed in class.You may work with a partner on this assignment. Both of you must read thepaper on Pair Programming andabide by the ground rules as stated in that paper. The file will have a header of the following form:There will be only one copy of the file being submitted if you are doing pair programming.

    Use the Canvas system to submit your Blackjack.py file. We should receive your work by 11 PM on Sunday, 19 Feb 2017. There will be substantial penalties if you do not adhere to the guidelines. Remember Python is case sensitive. The name of your file must match exactly what we have specified.

    • Your Python program should have the proper header.
    • Your code must run on the command line before submission.
    • You should be submitting your file through the web based Canvas program. We will not accept files e-mailed to us.
    • Here is the Grading Criteria.

    Blackjack Programming Assignment Examples

    • Stelly's

      • Teachers

        • BARCHEN, Trevor

        • BARTLETT, Alicia

        • BERGER, Dan

        • BERGSMA, Andra

        • BISHOP, Jeffrey

          • Archived Courses

        • BOSMAN, Sonje

        • BRAUN, Ryan

        • BROWN, Taryn

        • COLLINS, Mike

        • CUNNINGHAM, Michelle

        • DILDY, Jessi

        • DOUGLAS, Luke

        • FITZGERALD, Naomi

        • GILLESPIE, AL

        • GLUBE, Stephanie

        • GORDON, Scott

        • HART, Brad

        • HEINEKEY, Douglas

        • HEYWOOD, Peter

        • HILTON, Maria

        • HOFFMAN, Amanda

        • JULIEN, Matthew

        • KEDVES, Alice

        • KOENIG, Kim

        • LAMPARD, Aimee

        • LARSEN, Garret

          • Student Services

        • LEVESQUE, Gwen

        • LIBERATORE, Tasha

        • LIZAMA, Isabel

        • LOCKHART, Tim

        • MANNING, Maureen

        • MATHESON, Sarah

        • McDONALD, Chris

            • Participants

            • General

            • Computer Science 11 (Visual Basic)

            • AP Computer Science (Java)

            • Computer Programming 11/12 Spring 2020 – Mr. McDo..

        • MCNAMEE, Lara

        • MONTGOMERY, Lynn

        • RYALL, Linda

        • SCHOFIELD, Eric

        • SIDHU, Asha

        • SIEBERT, Jon

        • STRUTYNSKI, Stephen

        • TAMBOLINE, Camille

        • TISSARI, Timo

        • VOPNFJORD, Char

        • WALLACE, Catherine

        • WHEELDON, Roy

        • ZIEGLER, Norbert

      • Home

      • About

      • Students

      • Parents

      • Staff

      • Resources

      • Programs

      • Boulders

      • Calendar

      • Contact

      • Main Menu Items





    broken image