Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Visual Studio OOP Blackjack game. Goals to build C# objects to use objects to think both procedurally and OOP to use Windows Forms Programming and
Visual Studio OOP Blackjack game.
Goals
- to build C# objects
- to use objects
- to think both procedurally and OOP
- to use Windows Forms Programming and Event Handling
Here is was I need to make. There are three buttons on the right. The top to reset the game, the middle one is the hit button that lets you draw another card, and the third is the stay button. You can only see the dealer's first card and don't know the value of his second card until you hit stay. When you hit stay it will reveal the dealer's hand and have a message box pop up saying if you win, lose, or tie against the dealer.
Current progress :
Black Jack Total value of dealers hand ?? | HTMEV Total value of players hand ?? STAY COP2362 BlackJack! X BLACK JACK YOU WIN!! Player total is 21 Dealer total value is 13 Form1.cs [Design]* Hand.cs Class2.c* + x Form1.cs* C# GreenvilleRevenueGUI 3 references class Cards GreenvilleRevenueGUI.Cards . .LoadCards Random ranNumberGenerator; int currentcardnumber = -1; private Card[] AllCards = new Card[52]; private int currentcard = 0; Card ACardBack; Random randomcard = new Random(); 1 reference public Cards Solution Explorer - IX @ 0. - 5020 >> - Search Solution Explorer (Ctrl+;) Solution 'GreenvilleRevenueGUI' (1 of 1 project) C# GreenvilleRevenueGUI Properties - References App.config C# Class1.cs C# Class2.cs 9 Form1.cs C# Hand.cs C# Program.cs LoadCards(); ShuffleCards (ref AllCards); 1 reference private void LoadCards() Card Acard; String msg = ""; int value = 5; string[] list = Directory.GetFiles(@"cards", "*.gif"); string[] list2 = Directory.GetFiles(@"cards", "wfswbackcard*.gif"); Image Backimage = Image.FromFile(list2[0]); ACardBack = new Card(Backimage, 0); for (int index = 0; index = 52) currentcard = 0; return AllCards[currentcard++]; 1 reference private int GetNextCardValue(int currentcard) int cardvalue = 0; if I current and 231 100% - 0 A1 Error List Output Ready . Ln31 Col 13 Ch 13 INS 1 Add to Source Control - ? Form1.cs* Form1.cs [Design]* 1 x Hand.cs Class2.cs* + x C# GreenvilleRevenueGUI GreenvilleRevenueGUI.Cards GetNextCardo 56 1 reference private int GetNextCardValue(int currentcard) Server Explorer Toolbox Data Sources int cardvalue = 0; if (currentcard Search Solution Explorer (Ctrl+;) Solution 'GreenvilleRevenueGUI' (1 of 1 project) 4 C# GreenvilleRevenueGUI Properties -1 References App.config C# Class1.cs C# Class2.cs Form1.cs C# Hand.cs C# Program.cs cardvalue = (currentcard / 4) + 2; else cardvalue = 10; return cardvalue; 1 reference public int GetCurrentCardNumber() return currentcard; 1 reference public void ShuffleCards (ref Card[] AllCards) Random rnd = new Random(); Card temp; int num; for (int i = 0; i Search Solution Explorer (Ctrl+;) Solution 'GreenvilleRevenueGUI' (1 of 1 project) C# GreenvilleRevenueGUI Properties -1 References App.config C# Class1.cs C# Class2.cs Form1.cs C# Hand.cs C# Program.cs namespace GreenvilleRevenueGUI 18 references class Card private Image image; private int value; private int secondvalue; private Boolean IsAce; 2 references public Card(Image myimage, int myvalue) image = myimage; value = myvalue; IsAce = false; secondvalue = 0; 4 references public Image GetCard Image) return image; 3 references public int GetCardValue() Solution Explorer Team Explorer Properties return value; IX 100 % - No issues found Error List ... Output E Ready . Ln1 Coll chi INSI 1 Add to Source Control - 21 Black Jack Total value of dealers hand ?? | HTMEV Total value of players hand ?? STAY COP2362 BlackJack! X BLACK JACK YOU WIN!! Player total is 21 Dealer total value is 13 Form1.cs [Design]* Hand.cs Class2.c* + x Form1.cs* C# GreenvilleRevenueGUI 3 references class Cards GreenvilleRevenueGUI.Cards . .LoadCards Random ranNumberGenerator; int currentcardnumber = -1; private Card[] AllCards = new Card[52]; private int currentcard = 0; Card ACardBack; Random randomcard = new Random(); 1 reference public Cards Solution Explorer - IX @ 0. - 5020 >> - Search Solution Explorer (Ctrl+;) Solution 'GreenvilleRevenueGUI' (1 of 1 project) C# GreenvilleRevenueGUI Properties - References App.config C# Class1.cs C# Class2.cs 9 Form1.cs C# Hand.cs C# Program.cs LoadCards(); ShuffleCards (ref AllCards); 1 reference private void LoadCards() Card Acard; String msg = ""; int value = 5; string[] list = Directory.GetFiles(@"cards", "*.gif"); string[] list2 = Directory.GetFiles(@"cards", "wfswbackcard*.gif"); Image Backimage = Image.FromFile(list2[0]); ACardBack = new Card(Backimage, 0); for (int index = 0; index = 52) currentcard = 0; return AllCards[currentcard++]; 1 reference private int GetNextCardValue(int currentcard) int cardvalue = 0; if I current and 231 100% - 0 A1 Error List Output Ready . Ln31 Col 13 Ch 13 INS 1 Add to Source Control - ? Form1.cs* Form1.cs [Design]* 1 x Hand.cs Class2.cs* + x C# GreenvilleRevenueGUI GreenvilleRevenueGUI.Cards GetNextCardo 56 1 reference private int GetNextCardValue(int currentcard) Server Explorer Toolbox Data Sources int cardvalue = 0; if (currentcard Search Solution Explorer (Ctrl+;) Solution 'GreenvilleRevenueGUI' (1 of 1 project) 4 C# GreenvilleRevenueGUI Properties -1 References App.config C# Class1.cs C# Class2.cs Form1.cs C# Hand.cs C# Program.cs cardvalue = (currentcard / 4) + 2; else cardvalue = 10; return cardvalue; 1 reference public int GetCurrentCardNumber() return currentcard; 1 reference public void ShuffleCards (ref Card[] AllCards) Random rnd = new Random(); Card temp; int num; for (int i = 0; i Search Solution Explorer (Ctrl+;) Solution 'GreenvilleRevenueGUI' (1 of 1 project) C# GreenvilleRevenueGUI Properties -1 References App.config C# Class1.cs C# Class2.cs Form1.cs C# Hand.cs C# Program.cs namespace GreenvilleRevenueGUI 18 references class Card private Image image; private int value; private int secondvalue; private Boolean IsAce; 2 references public Card(Image myimage, int myvalue) image = myimage; value = myvalue; IsAce = false; secondvalue = 0; 4 references public Image GetCard Image) return image; 3 references public int GetCardValue() Solution Explorer Team Explorer Properties return value; IX 100 % - No issues found Error List ... Output E Ready . Ln1 Coll chi INSI 1 Add to Source Control - 21Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started