In Java please!! Your objective is to beat the dealer's hand without going over 21. Cards dealt...

50.1K

Verified Solution

Question

Programming

In Java please!!

Your objective is to beat the dealer's hand without going over21. Cards dealt (randomly) are between 1 and 11. You receive 2cards, are shown the total, and then are asked (in a loop) whetheryou want another card. You can request as many cards as you like,one at a time, but don't go over 21. (If you go over 21 it shouldnot allow you any more cards and you lose) Determine the dealer'shand by generating a random number between 1 and 11 and adding 10to it. Compare your hand with the dealer's hand and indicate whowins (dealer wins a draw)

Answer & Explanation Solved by verified expert
4.5 Ratings (877 Votes)
import javautil public class BeatDealer public static void mainString args Scanner scanner new ScannerSystemin String    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students