Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.util.Scanner; public class ashercards { public static void main ( String args [ ] ) { Scanner scanner = new Scanner ( System .
import java.util.Scanner;
public class ashercards
public static void mainString args
Scanner scanner new ScannerSystemin;
System.out.printlnEnter the card shorthand notation egH: ;
String input scanner.nextLine;
scanner.close;
String value input.substring input.length;
char suit input.charAtinputlength;
String cardValue getCardValuevalue;
String cardSuit getCardSuitsuit;
System.out.printlnFull description of the card: cardValue of cardSuit;
public static String getCardValueString value
switch value
case A: return "Ace";
case : return "Two";
case : return "Three";
case : return "Four";
case : return "Five";
case : return "Six";
case : return "Seven";
case : return "Eight";
case : return "Nine";
case : return "Ten";
case J: return "Jack";
case Q: return "Queen";
case K: return "King";
default: return "Unknown";
public static String getCardSuitchar suit
switch suit
case D: return "Diamonds";
case H: return "Hearts";
case S: return "Spades";
case C: return "Clubs";
default: return "Unknown";
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started