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

  Program that computes the amount of money the computer club

Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project. Allow the user to enter the number of cases sold and the sale price per bar. Each case contains 12 bars; each case is p..

  Implement the program by using vb.net

Draw all the diagrams which need it in the assignment by using smart draw program - the diagrams should match with the system

  Write a program that inputs a file of text

Write a program that inputs a file of text and counts the occurrence of words in the text (for example, "write" appears 1 time in this sentence; "a" appears 2 times).

  Create a c# program that includes a coffeeorder class

Create a program that includes the following requirements: Create a CoffeeOrder class

  Write a vbnet windows application to aid in the calculation

Write a VB.NET Windows application to aid in the calculation of reconnect charges for delinquent electric customers. When customers fail to pay their electric bill.

  How linear structures-particularly arrays-are implemented

Project at work calls for storage of computer maintenance schedule information. Using C# as source language, investigate how linear structures-particularly arrays-are implemented.

  Design implement test and debug a c program which displays

design implement test and debug a c program that displays a pets name when a button is clicked.must be created in

  Prepare a small software

You need to prepare a small software .NET2.0 in C# -  The admin panel must have a place to perform the search commands - the admin panel must display files metadata and pic info.

  Name some form controls used with dotnet

Managing validation becomes a rather onerous task when you have to design a contact form, an event registration form, a sign in form, etc. What are some form controls used with .NET? Explain your answer.

  Create c# application that lets user select training course

Create a C# application (named TrainingSelector) that lets the user select a training course from a ListBox and a location from another ListBox.

  Design style elements in asp

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

  Webite hi sir u need to bild the website the qustion sheet

hi sir u need to bild the website .the qustion sheet is cis2oo3 file and the rubal is the rar file which i had done for

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