CSCI 261 - Programming Concepts (C++)Fall 2016 - Assignment 06 - Naïve BlackjackQuick Links: Blackboard | EECS | Mines | Piazza | zyBooks |
|||||||||
| Home | Contact | Syllabus | Assignments | Schedule | Resources | | |||||||||
This assignment is due by October 05, 2016 08:00am.
In this homework, we will combine everything we've learned so far with a focus on
struct and string .OverviewFor this assignment, your job is to create a simple Blackjack game where a user plays against a computerized Dealer.
The SpecificsYou must first create a
struct named Card to represent a playing card. It should have two fields, a rank stored as an int and a suit stored as a string .Next create a function that generates a random Card variable (perhaps call it RandomCard). Since this is Naïve Blackjack, we do not care if two cards are in play at once or how many of each card are available. This function should generate a random rank for the card (between 1-10) and a random suit for the card. The function should take nothing as input and return a Card as output.
At this point, everything is in place to start our game. Follow this pseudocode to complete the remainder of the assignment:
It looks like a lot of steps, but the majority of those steps are describing the rules of Blackjack. Once completed, hopefully you find this assignment enjoyable to play and try to beat the computer. Sample output and program flow could be as follows:
Dealer shows the 3 of Clubs Dealer total is: 3 You were dealt the 3 of Clubs You were dealt the 7 of Hearts Your total is: 10 Do you want to "Hit", "Stand"? > Hit You were dealt the 3 of Diamonds Your total is: 13 Do you want to "Hit", "Stand"? > Hit You were dealt the 6 of Spades Your total is: 19 Do you want to "Hit", "Stand"? > Stand Dealer was dealt the 6 of Diamonds Dealer total is: 9 Dealer was dealt the 6 of Hearts Dealer total is: 15 Dealer was dealt the 7 of Spades Dealer total is: 22 Dealer busted! You win Do you want to play again? "Yes" or "No"? > No We will revisit this assignment later to make a smarter Blackjack game where our cards are correctly limited to a standard 52 card deck.
Functional Requirements
Hints
Grading Rubric
Your submission will be graded according to the following rubric.
SubmissionAlways, always, ALWAYS update the header comments at the top of your main.cpp file. And if you ever get stuck, remember that there is LOTS of help available.
In summary, for homework due on Wednesday, October 05 follow these specific steps:
This assignment is due by October 05, 2016 08:00am.
| |||||||||
Last Updated: 01/01/70 00:00
|