subject

The child’s game, War, consists of two players each having a deck of cards. In the actual card game, for each play, each person turns over the top card in his or her deck. The higher card wins that round of play and the winner takes both cards. The game continues until one person has all the cards and the other has none. Create a program that simulates a modified game of War. The computer will play both hands, as PlayerOne and PlayerTwo, and, for each round will generate two random numbers and compare them. If the first number is higher, PlayerOne’s score is increased by 1 and if the second number is higher, PlayerTwo’s score is increased by 1. If there is a tie, no score is incremented. When one "player" reaches a score of 10, that player should be deemed the winner and the game ends. The range of numbers should be 1-13 to simulate the values of cards in the deck. You do not have to declare "suits"; the random number values alone determine the value of the card.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:00
The following function returns a string of length n whose characters are all 'x'. give the order of growth (as a function of n) of the running time. recall that concatenating two strings in java takes time proportional to the sum of their lengths. public static string f(int n) { if (n == 0) return ""; if (n == 1) return "x"; return f(n/2) + f(n - n/2); } options: a) constant b) logarithmic c) linear d) linearithmic e)quadratic f)cubic g) exponential
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 24.06.2019 03:00
What is one potential problem associated with an organization purchasing new technology early in its lifecycle
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Two students are discussing the flow of electricity. student a says that voltage is a measure of the amount of electron flow in a circuit. student b says that power is the product of voltage and current. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
You know the right answer?
The child’s game, War, consists of two players each having a deck of cards. In the actual card game,...
Questions
question
Mathematics, 08.10.2020 14:01
question
Mathematics, 08.10.2020 14:01
question
Mathematics, 08.10.2020 14:01
question
History, 08.10.2020 14:01
Questions on the website: 13722360