Java Reference
In-Depth Information
Notation
Meaning
A
Ace
2 Ȟ 10
Card values
J
Jack
Q
Queen
K
King
D
Diamonds
H
Hearts
S
Spades
C
Clubs
Your program should print the full description of the card. For example,
Enter the card notation:
4S
Four of spades
Implement a class Card whose constructor takes the card notation string
and whose getDescription method returns a description of the card.
If the notation string is not in the correct format, the getDescription
method should return the string ÑUnknownÑ .
221
222
΢΢ Exercise P5.3. Write a program that reads in three floating-point numbers
and prints the three inputs in sorted order. For example:
Please enter three numbers:
4
9
2.5
The inputs in sorted order are:
2.5
4
9
΢
Exercise P5.4. Write a program that prints the question ȓDo you want to
continue?ȓ and reads a user input. If the user input is ȓYȓ, ȓYesȓ, ȓOKȓ, ȓ
Sureȓ, or ȓWhy not?ȓ, print out ȓOKȓ. If the user input is ȓNȓ or ȓNoȓ,
then print out ȓTerminatingȓ. Otherwise, print ȓBad inputȓ. The case of the
user input should not matter. For example, ȓyȓ or ȓyesȓ are also valid
inputs. Write a class YesNoChecker for this purpose.
Search WWH ::




Custom Search