## Homework Assignment #6. For MW class, assigned MON NOV 19, due MON NOV 26 11:59pm Assignment #6. For TH class, assigned TUE NOV 20, due TUE NOV 27 11:59pm

Use the random number generator in a Java program to simulate the dealing of N cards to a player, where N is generated by (int)(4*Math.random() + 1), i.e., it varies from 1 to 4. Your program should print the score where an ace is worth one point, the face cards worth 10 points and the rest worth their card value. The assignment will focus on the use of Math.random(), for loops and switch statements. MW class can use Prog4 on Nov 12 and TH class can use Prog4 on Nov 8 in writing their program.

Example run when N is 4:

```
Card #1         Card #2         Card #3        Card #4
five            Ace             King           ten
of              of              of             of
score is 26.

```

Example run when N is 2:

```
Card #1         Card #2
two             Jack
of              of
score is 12.

```

REQUIREMENTS:

• Use Math.random() to generate a random number between 1 and 13 (1 is an Ace, 11 is a Jack, 12 is a Queen, and 13 is a King ... 2 thru 10 obviously represent the card values 2 thru 10) each time you deal a card.
• Use Math.random() to generate a random number between 1 and 4 (1 is Diamonds, 2 is Hearts, 3 is Spades, and 4 is Clubs) each time you deal a card
• You MUST include two methods, each containing a random number generator and a switch statements, one, public static int value(), to handle the printing of the card rank and return its value , and one, public static void suit(), to handle the printing of the card suit. Each of these methods contain print() statements in the switch block. Make sure your program does not print something like 12 of Spades (this is why you need the switch statements).
You will need another method called of() that prints the word "of" on the third line. Note that all the suits are printed in the singular not plural. This is to preserve the column format. Also, each card, including the first one is printed after two tabs.
• You will make use of the "\t" escape sequence (to advance the cursor to next horizontal tab position). You will have to use "\t\t" to advance the cursor two tab positions each time.
• Note that your program may actually "deal" the same card more than once (for example, the 3 of Diamonds may appear 2 or more times). This is OK.
• THE OUTPUT OF YOUR PROGRAM SHOULD MATCH THE FORMAT IN THE EXAMPLES ABOVE!
• Hint: you should use three for loops, one to print the value of the rank N times, one to print "of" N times, and one to print the value of the suit N times.