0

i need a code for this java program...urgent please...
using dialog boxes :
input month in "99" form
date in "99" form
year = 2009
then display the date in 'MMM 99, 2009' form
otherwise, display 'invalid date'

Valid date
01-12 = Values for month
01-28 = for month - 2
01-30 = for months - 4,6,9,11
01-31 = for months - 1,3,5,7,8,10,12

3
Contributors
2
Replies
4
Views
8 Years
Discussion Span
Last Post by masijade
0
...
 boolean isvalid=true;
 switch(m) {
     case 1:
     case 3:
     case 5:
     case 7:
     case 8:
     case 10:
     case 12:
                  if(d<1 || d>31)
                        isvalid=false;
                  break;
    case 4:
    case 6:
    case 9:
    case 11:
                ...
                break;
    case 2:
               ....
               break;
   ....  
 }
...
0

As I told you in your multipost:

Okay? So what do you have, and what error/compiler messages are you getting from it, or what is it doing that you don't expect, or vice-versa.

You will notice the terms and conditions of this site (which you agreed to when you signed up here), forbid us simply giving you a solution to your homework (as if we would, anyway).

P.S. Unless forbidden for you to use it, use SimpleDateFormat not any kind of case or "home-grown" solution. Why reinvent the wheel.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.