Difference between revisions of "Days in a Month"
Line 1: | Line 1: | ||
{{1010PrAD|ProblemName=Days in a Month | {{1010PrAD|ProblemName=Days in a Month | ||
− | |Problem=Create a program that allows the user to enter a month, and then outputs the number of days in that month. For simplicity sake, ask the user for the number of the month rather than the string. Also, assume there are 28 days in February. | + | |Problem=Create a program that allows the user to enter a month, and then outputs the number of days in that month. For simplicity sake, ask the user for the number of the month rather than the string. Also, assume there are 28 days in February. Use JOptionPane.showInputDialog to capture the input, and System.out.println to generate the output. Make sure the user enters a valid month (1-12). If they do not enter valid input, output "Invalid Input". |
Revision as of 15:44, 2 April 2010
Back to the Program-A-Day homepage
ProblemCreate a program that allows the user to enter a month, and then outputs the number of days in that month. For simplicity sake, ask the user for the number of the month rather than the string. Also, assume there are 28 days in February. Use JOptionPane.showInputDialog to capture the input, and System.out.println to generate the output. Make sure the user enters a valid month (1-12). If they do not enter valid input, output "Invalid Input".
|
SideSectionTitle
An image or By Students section | |
---|---|---|
Solution | ||
CodeSolutionCode goes here. Please DO NOT put your code in <pre> tags! |