Java Reference
In-Depth Information
*4.14
( Convert letter grade to number ) Write a program that prompts the user to enter a
letter grade A, B, C, D, or F and displays its corresponding numeric value 4, 3, 2,
1, or 0. Here is a sample run:
Enter a letter grade: B
The numeric value for grade B is 3
Enter a letter grade: T
T is an invalid grade
*4.15
( Phone key pads ) The international standard letter/number mapping found on the
telephone is shown below:
Write a program that prompts the user to enter a letter and displays its correspond-
ing number.
Enter a letter: A
The corresponding number is 2
Enter a letter: a
The corresponding number is 2
Enter a letter: +
+ is an invalid input
4.16
( Random character ) Write a program that displays a random uppercase letter
using the Math.random() method.
*4.17
( Days of a month ) Write a program that prompts the user to enter a year and the
first three letters of a month name (with the first letter in uppercase) and displays
the number of days in the month. Here is a sample run:
Enter a year: 2001
Enter a month: Jan
Jan 2001 has 31 days
 
Search WWH ::




Custom Search