Compare the highest card for each player

Assignment Help Engineering Mathematics
Reference no: EM131787667

In this assignment you will be using If statements and random numbers.

The random numbers will be simulating playing cards. The face values of the cards are as follows

Number & Value Card Face
2-10 number = face
11 jack
12 queen
13 king
14 Ace

You will be coding a two player game.

You will be generating the value of cards using the random number generator (see week 2 notes) where each card will have a value between 2 and 14.

Task 1:
- Input the name of the player
- For the first player, generate 3 random cards. Print all these three values for testing purposes
- Compare the values of the cards and output a message stating the face of the highest card (e.g. if the highest number generated is 11, output a suitable message such "Your highest card is a jack")

Task 2:

Do the same for the second player.

Task 3:
Compare the highest card for each player in all 3 rounds and output a message saying who has the highest card (e.g. Player2 has the highest card if Player1=10, Player 2 =12 (Queen) or whether the values have drawn (i.e. both the players have the same value card).

Task 4:
Total the face values of the cards for each player after three rounds and display the total face value for each player, stating which player has the highest overall value.

Task 5:

When generating each card, generate a number between 15 and 18 to represent the suit e.g.

Number suit
11 clubs
12 diamonds
13 hearts
14 spades

Display the suit along with the card for e.g. 7 of clubs

Reference no: EM131787667

Questions Cloud

Write declarations that initialize variables : Write declarations that initialize variables ptr1 and ptr2 with the addresses of i I and i 2, respectively.
Student can outline a multi-channel distribution system : Marketing channel strategy. Student can recommend a marketing channel strategy for a product or service offering that assures the correct amount of intensity.
Declarations that initialize variables ptr1 and ptr2 : Write declarations that initialize variables ptr1 and ptr2 with the addresses of i I and i 2, respectively.
Identify important controls and related sales transaction : Identify the important controls and related sales transaction-related audit objectives. List the procedures that a CPA will use in an audit of sales transaction
Compare the highest card for each player : Compare the values of the cards and output a message stating the face of the highest card - Compare the highest card for each player
How many boxes of lettuce should the supermarket purchase : The local supermarket buys lettuce each day to ensure really fresh produce. How many boxes of lettuce should the supermarket purchase tomorrow?
Discuss previously issued common stock : The company had the following dividend information
What advantages do compensating balances have for banks : What advantages do compensating balances have for banks? Are the advantages to banks necessarily disadvantages to corporate borrowers?
Find and interpret the interquartile range for the book : Best-selling Books The numbers of copies sold (in millions) for the top ten best-selling books in 2015-2016 are shown in the table.

Reviews

Write a Review

Engineering Mathematics Questions & Answers

  Prime number theorem

Dirichlet series

  Proof of bolzano-weierstrass to prove the intermediate value

Every convergent sequence contains either an increasing, or a decreasing subsequence.

  Antisymmetric relations

How many relations on A are both symmetric and antisymmetric?

  Distributed random variables

Daily Airlines fies from Amsterdam to London every day. The price of a ticket for this extremely popular flight route is $75. The aircraft has a passenger capacity of 150.

  Prepare a system of equations

How much money will Dave and Jane raise for charity

  Managing ashland multicomm services

This question is asking you to compare the likelihood of your getting 4 or more subscribers in a sample of 50 when the probability of a subscription has risen from 0.02 to 0.06.]  Talk about the comparison of probabilities in your explanation.

  Skew-symmetric matrices

Skew-symmetric matrices

  Type of taxes and rates in spokane wa

Describe the different type of taxes and their rates in Spokane WA.

  Stratified random sample

Suppose that in the four player game, the person who rolls the smallest number pays $5.00 to the person who rolls the largest number. Calculate each player's expected gain after one round.

  Find the probability density function

Find the probability density function.

  Develop a new linear programming for an aggregate production

Linear programming applied to Aggregate Production Planning of Flat Screen Monitor

  Discrete-time model for an economy

Discrete-time model for an economy

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