Find Jobs
Hire Freelancers

Basic Blackjack program in Dev C++

$30-250 USD

Sürüyor
İlan edilme: neredeyse 13 yıl önce

$30-250 USD

Teslimde ödenir
This project is due on 6/9/2011. You have the option to work in a group of 2s. Grading criteria: 1) The use of at least two functions/procedures (not including main: for example, Deal, Bet) 2) The use of arrays 3) The use of comments and correct variable declarations. 4) The correctness of the code. (Does it meet the requirements?) This project will simulate a blackjack program. It will put one player against the computer. The player will be able to wage money on the game. The game will continue until the player does not want to play anymore or he/she runs out of money. This program will start with the following prompt: How much money are you playing with today? 1000 The user will then enter how much money they are playing with. A sample execution of the program is as follows: What is your wager? 10001 Sorry, you can’t wager10001, you only have 1000 left What is your wager? 2 Sorry, the minimum bet for this table is 10 What is your wager? 50 Your cards are 5,10 Your sum is 15. Would you like to hit(1) or stay(2)? 1 You got a J. Your sum is 25. You lose this game. You have $950 left. Would you like to play again? Yes(1) or No(2)?: 1 What is your wager? 950 Your cards are J,Q Your sum is 20. Would you like to hit(1) or stay(2)? 2 Computer’s cards: 6, 7, 5, 3 Computer got: 21 You lose this game. You have $0 left. Thank you for playing. Good bye. Rules If the dealer’s sum is less than 17, the dealer must take another card. If the dealer’s sum is 17 or above, the dealer must stand The deck has 52 cards in it. Cards cannot be reused. Cards must be generated using some random number. You will need to keep track of the number and type of cards played. Assume Ace is always 11, unless you are over, then assume it is 1. The program will always ask the user to play again, unless the user has no more money to play. Blackjack, a total of 21 on your first two cards, pays normal (NOT 3:2) Advanced playing (such as doubling down, splitting pairs) IS NOT required. Hints: You will need to use an array to hold the deck. An array of 52 will work fine. You may want an array to keep track of the players hand and an array to keep track of the dealers hand. (This way you can change aces from 11 to 1 if needed) Create the array like this: int cards[52] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, //Array to initialize 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, //52 card 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,};//deck with 4 cards for each suit In this deck, 11 is a J, 12 is a Q, 13 is a K, and 14 is an Ace. In order to deal a card a) generate a random number between 0 and 51. random = rand() …..; b) See if the value of that array index is 0. Does cards[random] == 0? If it is, generate another random number until cards[random] doesn’t equal zero c) Show the card, and then set cards[random] = 0 d) Once all the cards have been dealt, then reset the array to the original state.
Proje No: 1090784

Proje hakkında

7 teklif
Uzaktan proje
Son aktiviteden bu yana geçen zaman 13 yıl önce

Biraz para mı kazanmak istiyorsunuz?

Freelancer'da teklif vermenin faydaları

Bütçenizi ve zaman çerçevenizi belirleyin
Çalışmanız için ödeme alın
Teklifinizin ana hatlarını belirleyin
Kaydolmak ve işlere teklif vermek ücretsizdir
Seçilen:
Kullanıcı Avatarı
Please see your PM for more details.
$40 USD 1 gün içinde
4,7 (19 değerlendirme)
4,3
4,3
7 freelancer bu proje için ortalama $69 USD teklif veriyor
Kullanıcı Avatarı
Hi,Please check your inbox,Thanks
$30 USD 0 gün içinde
4,8 (110 değerlendirme)
5,8
5,8
Kullanıcı Avatarı
Hi, I can do this assignment. Thanks ePerfections
$150 USD 1 gün içinde
5,0 (30 değerlendirme)
4,9
4,9
Kullanıcı Avatarı
Hello.I can deliver it on time and perfect quality. Please contact me
$100 USD 1 gün içinde
4,8 (3 değerlendirme)
4,5
4,5
Kullanıcı Avatarı
Hello, Please check pm.
$45 USD 2 gün içinde
3,9 (2 değerlendirme)
2,5
2,5
Kullanıcı Avatarı
Hi, We are ready to complete the work. We assure you that the work will be of the best quality. You will get the work as per your time deadline. Our motto is best quality work and strict on time deadline. Please check PM. Thanks
$90 USD 1 gün içinde
0,0 (1 değerlendirme)
0,0
0,0
Kullanıcı Avatarı
Very easy coding
$30 USD 0 gün içinde
0,0 (0 değerlendirme)
0,0
0,0

Müşteri hakkında

   UNITED STATES bayrağı
Virginia Beach, United States
4,6
2
Haz 8, 2011 tarihinden bu yana üye

Müşteri Doğrulaması

Bu müşterinin diğer işleri

Pizza ordering page
$30-250 USD
Teşekkürler! Ücretsiz kredinizi talep etmeniz için size bir bağlantı gönderdik.
E-postanız gönderilirken bir şeyler yanlış gitti. Lütfen tekrar deneyin.
Kayıtlı Kullanıcı İlan Edlien Toplam İş
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ön izleme yükleniyor
Coğrafik konum için izin verildi.
Giriş oturumunuzun süresi doldu ve çıkış yaptınız. Lütfen tekrar giriş yapın.