Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Engineering Mathematics Expert

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

Engineering Mathematics, Engineering

  • Category:- Engineering Mathematics
  • Reference No.:- M92596349
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Engineering Mathematics

Clculus assignment -q1 find the total differential of w

CALCULUS ASSIGNMENT - Q1. Find the total differential of w = x 3 yz + xy + z + 3 at (x, y, z) = (1, 2, 3). Q2. Find the value of the double integral ∫∫ R (6x + 2y 2 )dA where R = {(x, y)| - 2 ≤ y ≤ 1, y 2 ≤ x ≤ 2 - y. Q3 ...

Q undirected vs directed connectivitya prove that in any

Q: Undirected vs. directed connectivity. (a) Prove that in any connected undirected graph G = (V, E) there is a vertex v ? V whose removal leaves G connected. (Hint: Consider the DFS search tree for G.) (b) Give an examp ...

Math assignment -q1 let fx -x3-cosx and p0 1 use newtons

Math Assignment - Q1. Let f(x) = -x 3 -cos(x), and p 0 = 1. Use Newton's method to find p 2 . Could p0=0 be used? Q2. Perform two iterations by Newton's method and the secant method to each of the following: a. e x + 2 - ...

Assignment - lp problemsthe data for all the problems in

Assignment - LP problems The data for all the problems in this HW are included in the LP_problems_xlsx spreadsheet Problem 1: Cash Planning A startup investment project needs money to cover its cash flow needs. At the en ...

Show all your work not just the answerswhen you multiply 21

(SHOW ALL YOUR WORK, not just the answers) When you multiply: 21 x 68 you most likely do: 8x1 + 8x20 + 60x1 + 60x20 = 1, 428 So, there are 4 multiplications and then 3 additions. How long would it take a computer to do t ...

Question 1 - many spas many componentsconsider 4 types of

Question 1 - Many spas, many components Consider 4 types of spa tub: Aqua-Spa (or FirstSpa, or P1), Hydro-Lux (or SecondSpa, or P2), ThirdSpa (or P3) and FourthSpa (or P4), with the production of products P1, ..., P4 in ...

Problem 1given a sequence xn for 0lenle3 where x0 1 x1 1

Problem # 1: Given a sequence x(n) for 0≤n≤3, where x(0) = 1, x(1) = 1, x(2) = -1, and x(3) = 0, compute its DFT X(k). (Use DFT formula, don't use MATLAB function) Use inverse DFT and apply it on the Fourier components X ...

Problem -consider a closed convex set x sub rd a function h

Problem - Consider a closed convex set X ⊂ R d , a function H : X x Ξ ι→ R d , and a deterministic nonnegative sequence {α n } such that n=0 ∑ ∞ α n = ∞ and n=0 ∑ ∞ (α n ) 2 = ∞. Consider an inner product (·, ·) on R d , ...

Numerical analysis assignment -q1 define the following

Numerical Analysis Assignment - Q1. Define the following terms: (i) Truncation error (ii) Round-off error Q2. Show that if f(x) = logx, then the condition number, c(x) = |1/logx|. Hence show that log x is ill-conditioned ...

Assignment - introduction to math programmingdirections

Assignment - Introduction to Math Programming Directions - Formulate a linear programming model for the following description. Include definitions of decision variables, Objective function, and constraints. Augment your ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As