954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

calendar program

i am working on a calendar program how do i produce an error if the year is less than or equal to 1582 is this right it looks right to me if they entered high i want the program to continue any help me with this give me links to tutorials that can help too

System.out.println("Enter the year" );
year = Scan.nextInt();
if (year <= 1582)
System.out.println("Error that is year the calender was invented");
else
{
System.out.println("You Entered the following year" +year);

}

intelli
Newbie Poster
9 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
 

define: produce an error.
this way, you'll show a line in your Dos prompt. is this what you want to do?
if so, you have to place all the code that you want only to be run if the year's right in the else block of your if-statement

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You