Design a c# program to simulate playing the card game war

Assignment Help DOT NET Programming
Reference no: EM131317871

Assignment

Design, implement, test, and debug a C# program to simulate playing the card game War. Utilizing the C# random number generator, deal 26 sets of 2 cards each. This should be accomplished with only one click of a button. The "cards" should be values 1 through 13; 1 is an ace, two is a two, etc.; and 11 is a jack, 12 is a queen, and 13 is a king. Keep two counters - one for player 1 and one for player 2. As you deal the cards (ie, generate the numbers in a loop), if the first card is larger than the second, add 1 to player 1's counter. If the second card is larger than the first, add 1 to player 2's counter. For the purposes of this program, a 2 will beat an ace. Also, as you deal the cards, write the results to a text file. The results should contain the values of both cards dealt and which player won that deal. For example, the record written to the text file could say "Player 1 dealt 3, player 2 dealt 11, player 2 wins". It is not necessary to translate a 1 into "ace", an 11 into "jack", a 12 into "queen", or a 13 into "king". After 26 deals of cards, the results will be read from the text file and displayed on the form. The type of application to be developed is a Windows Forms application. Please note that graphics are not needed. This program is only a simulation; it is not intended to actually look like the user is dealing cards. Also please note that no complicated algorithms or logic is needed. You do not need to do any logic to ensure that 52 unique cards are dealt or anything related to the suit of the card. The assignment is simply to see how you do with the key concepts for this week.

When the user clicks a Deal Cards button, the program will write the values of the cards "dealt" to each of the players as noted above. If I open the text file written, I should see 26 records, with three things on each record (the value of each card and the winner of the deal). If the deal is a tie, note it in the results.

Notify the user in some way that the game is done and the file is written.

After the file is written, the user may click a Display Game Results button to read the items back in and display the results in a textbox or listbox. When I look at the form after I click the Display Game Results button, I should see 26 entries on the form. Also create 2 labels on the form. In the first label, display the number of deals won by player 1 (such as "Player 1 won 10 deals"). In the second label, display the number of deals won by player 2.

Include identifying information in the form of block comments at the top of each class in the project (programmer name, date, program description). Include adequate comments throughout the program, utilize meaningful names for controls, variables, fields, and forms. Include white space for readability purposes in the code. The focus of the project is on learning the C#.Net syntax. However, ensure the form is simple and easy to understand for the user.

Reference no: EM131317871

Questions Cloud

Which of the above actions would improve this ratio : Assume that the company has a current ratio of 1.2. Now, which of the above actions would improve this ratio? Modern Medical Devices has a current ratio of 0.5. Which of the following actions would improve (i.e., increase) this ratio? Use cash to pay..
Calculate the earning assets to total assets : Calculate the Earning assets to total assets, Interest margin to average earning assets, Loan loss coverage ratio and Equity to total assets for 2011, 2010, and 2009:
Estimating the wacc : What mistakes are commonly made when estimating the WACC, and how do these mistakes arise?
Investment portfolios in south-east asia : The risk-return profile that this company holds is somewhat conservative, they are used to hold a return (average) of 30% on their other investment portfolios in South-east Asia, USA and Europe.
Design a c# program to simulate playing the card game war : Design, implement, test, and debug a C# program to simulate playing the card game War. Utilizing the C# random number generator, deal 26 sets of 2 cards each.
Summarize the video and the main themes contained in it : Summarize the video and the main themes contained in it.Connect these themes to what we have covered and what you gave learned during the course.
Decision of the federal reserve bank : Explain how the decision of the Federal Reserve Bank (Fed) to raise interest rates would be expected to affect each component of the weighted average cost of capital (WACC). What mistakes are commonly made when estimating the WACC, and how do thes..
Projects have positive npv : Consider the following projects, X and Y where the firm can only choose one. Project X costs $600 and has cash flows of $400 in each of the next 2 years. Project Y also costs $600, and generates cash flows of $500 and $275 for the next 2 years, re..
Investment should the firm choose : Project Y also costs $600, and generates cash flows of $500 and $275 for the next 2 years, respectively. Which investment should the firm choose if the cost of capital is 10 percent?

Reviews

Write a Review

DOT NET Programming Questions & Answers

  Develop web services based application

Develop and test a Web services based application that meets the requirements applying SOA design principles.

  Design style elements in asp

Add drop down lists for modifying the different style elements for the label element that displays the time

  Create a shopping cart in asp

The users will use a browser to access the on-line store. The web server software for the production web server is Windows 2003 Server /IIS6.

  Inventory management system in c# application

Inventory management system in c# application

  Using .net resources to teach .net

This project will use the .NET framework to produce a set of materials to demonstrate the fundamental principles of .NET. Ideally it should demonstrate some of the principles of the framework e.g. interoperability.

  Prepare a marymount faculty site

Prepare a Marymount faculty site

  Blinky lights

Analysis proving that your code blinks the LEDs at the specified rates.

  Prepare a web application

Prepare a web application that will be used to keep track of patients registering in a hospital.

  Implementing the insurance management system

Implementing the Insurance Management System and implementation of Components as Web Services.

  Describe the characteristics of visual studio 2005

Describe the characteristics of Visual Studio 2005 Visual Studio.Net is a suite of products that includes 4 main languages. Name these languages and outline their use in industries

  What is a connectionstring

What is a ConnectionString. Give a suitable example to illustrate the various part of a ConnectionString

  Prepare a web application for internet service provider

Prepare a Web application and write the code also event planning document base. This web application allows the user to sign up for an Internet service provider for home connectivity.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd