Create two parallel arrays that represent a standard deck

Assignment Help Computer Engineering
Reference no: EM131851572

Problem

Create two parallel arrays that represent a standard deck of 52 playing cards. One array is numeric and holds the values 1 through 13 (representing Ace, 2 through 10, Jack, Queen, and King). The other array is a string array and holds suits ("Clubs", "Diamonds", "Hearts", and "Spades"). Create the arrays so that all 52 cards are represented. Create a War card game that randomly selects two cards (one for the player and one for the computer) and declares a winner or a tie based on the numeric value of the two cards. The game should play for 26 rounds, dealing a full deck with no repeated cards. For this game, assume that the lowest card is the Ace. Display the values of the player's and computer's cards, compare their values, and determine the winner. When all the cards in the deck are exhausted, display a count of the number of times the player wins, the number of times the computer wins, and the number of ties.

Here are some

• Move every higher-positioned card in the deck "down" one to fill in the gap. In other words, if the player's first random number is 49, select the card at position 49 (both the numeric value and the string), move the card that was in position 50 to position 49, and move the card that was in position 51 to position 50. Only 51 cards remain in the deck after the player's first card is dealt, so the available card array is smaller by one.

• In the same way, randomly select a card for the computer and "remove" the card from the deck.

Reference no: EM131851572

Questions Cloud

Create the logic for a program that merges the files : Create the logic for a program that merges the files for January and February to create a list of all books borrowed in the two-month period.
How does liner service support a hub and spoke effect : How does liner service support a hub and spoke effect? What are the 3 types of air cargo rates? Most air cargo falls into which type?
Design the logic for a program that merges the two files : Design the logic for a program that merges the two files into one file containing a list of all students in the district, maintaining student ID number order.
Describe what you believe to be the most significant factors : Describe what you believe to be the most significant factors contributing to such ethical collapses.
Create two parallel arrays that represent a standard deck : Create two parallel arrays that represent a standard deck of 52 playing cards. One array is numeric and holds the values 1 through 13.
Design the logic for the game hangman : Design the logic for the game Hangman, in which the user guesses letters in a hidden word. Store the letters of a word in an array of characters.
Create the logic for a dice game : Create the logic for a dice game. The application randomly "throws" five dice for the computer and five dice for the player.
Create the logic for an application that contains an array : Create the logic for an application that contains an array of 10 multiple-choice questions related to your favorite hobby.
What is the flow time of this process in minutes : What is amount of inventory inside the process boundaries of this process? Use units of measure consistent with this problem.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Utilize routers for connectivity devices instead of hubs

Utilize routers for connectivity devices instead of hubs

  Develop a proposal for each of the given approaches

Develop a proposal for each of these approaches: insourcing, outsourcing, and a combination of the two. Present the pros and cons or benefit analysis for each of the 3 proposals.

  Determine the doppler power spectrum

Repeat Illustrative Problem for a train traveling at a speed of 200 km/hour and a carrier frequency of 1 GHz.

  Evaluates equivalence relation

For each of the subsequent relation, evaluates if it's an equivalence relation, if it's right-invariant, and give the index if it is an equivalence relation.

  How would the computer represent the given decimal value

If our computer uses even parity, how would the computer represent the decimal value 295? If our computer uses 8-bit ASCII and even parity, how would the computer represent the string 295?

  Describing the views

Explain why do you think that views by themselves are insufficient in order to protect the access by the unauthorized users?

  Explain the steps of the user-centric design process

Compare the various types of human memory and their impact on the human-computer interface. Describe the potential outcomes of not using consistency in the human-computer interface. Summarize and explain the steps of the user-centric design process

  Discuss why is is important,

Describe what are the pros & cons IS in your business, Discuss why IS is important

  Write down an equation and draw a circuit

offer below is a truth table for a combinational logic circuit with three inputs and one output. Write an equation and draw a circuit which implements the function represented by this table.

  Slide presentation on access controls you may use various

slide presentation on access controls. you may use various sources including your textbook. be sure to cite any

  Create a text file called scores.txt with notepad

Create a text file called scores.txt with notepad with two lines: the first two lines are the computer scores and the second line human scores.

  Defining relationships within a database can improve

Defining relationships within a database can improve search capabilities and optimal performance of the database in the long run.

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