Question: beginner java help! file CardsGame.java The goal of this program is to take in user input describing a playing card in the following shorthand notation:
beginner java help!
file CardsGame.java
The goal of this program is to take in user input describing a playing card in the following shorthand notation:
A Ace
2....10 Card Values
J Jack
Q Queen
K King
D Diamonds
H Hearts
S Spades
C Clubs
The user input with be shorthand notation for a single card.
Your program will then output the full description for that card.
See the sample output below:
Welcome!
Enter the Card Notation: QS
You Entered: Queen of Spades
Here is another sample output:
Welcome!
Enter the Card Notation: 4H
You Entered: 4 of Hearts
To accomplish the goals of this program, you will need to use if statements, else if statements and an else clause (else is required!).
There are two approaches to the program
Complete the program using 52 if statements (one for each of the possible value and suit combinations of the playing cards).
OR, Complete the program with many fewer if statements, making use of the charAt() and length() methods for Strings
Both approaches work, and you may choose whichever option makes better sense to you.
Important note: you will receive a 0 if you use any String methods not covered in class.
Hint: The tricky part will be to handle the 10 correctly.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
