Write a Java program that will read numbers between 1 and 14 and will output the appropriate
Question:
Write a Java program that will read numbers between 1 and 14 and will output the appropriate symbol for a playing card of that rank (use switch).For cards between 2 and 10 just print the rank, for 1 and 11 print "Ace", for 12 print "Jack", for 13 print "Queen", and for 14 print "King". Use a for loop to read and process n cards (input from user). Your program should also handle invalid input.
Sample output:
Playing cards program.
Give me
some numbers and
I will tell you the appropriate playing card.
=============================================
How many numbers?
20
ERROR!
Should be positive.
Reenter:
5
Enter card number:
23
ERROR!
Out of range (1
14).
Reenter:
11
You
have an Ac
e.
Enter card number:
14
You
have a King.
Enter card number:
2
You
have a two.
Enter card number:
13
You
have a Queen.
Enter card number:
1
You
have an Ace.
How would I do this in java?
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang