Java Day of Birth Program
Ok so here's what I have so far..its a program that asks the user to enter the month,day,a dn year of birth in separate showInputDialog boxes. Basically what I'm having a problem with is I have to use a switch statement to express the day of the week as "Sunday", "Monday", and so on, instead of Java's regular interpretation 0,1, and so forth here's what I have

import java.util.GregorianCalendar;
import javax.swing.JOptionPane;   // Import JOptionPane from the swing class
import java.text.DateFormat;
public class FindDayOfBirth
{
 public static void main(String[] args)  //Main Method
 {

  // Declare and initialize variables


  String monthString, dayString,yearString;

  int month,day,year;

  monthString =JOptionPane.showInputDialog("Enter Month You were born in." );
  month = Integer.parseInt(monthString);         // Convert string into integer and stores the value  in age

  dayString = JOptionPane.showInputDialog("What's the day u were born on "); // Ask user for name of month
  day = Integer.parseInt(dayString);  // Convert string dayString into integer and store value in day.

  yearString = JOptionPane.showInputDialog("What's the year u were born on ");   // Ask user for numerical day born on
  year = Integer.parseInt(yearString);  // Convert string dayString into integer and store value in day.

  month-=1;
  GregorianCalendar birthYear = new GregorianCalendar(year,month,day);
  int birth = birthYear.get(GregorianCalendar.DAY_OF_WEEK);
  System.out.println( birth);
  switch (month)

  {
   //case 1: month = "January";
   //break;
   /*case 2: month = "February"
   case 3: month = "March"
   case 4: month = "April"
   case 5: month = "May"
   case 6: month = "June"*/
  }
  GregorianCalendar birthdate = new GregorianCalendar(year,month,day);
  long birthTime = birthdate.getTimeInMillis();
  DateFormat longDate = DateFormat.getDateInstance( DateFormat.LONG);
  String birthDateString = longDate.format(birthTime);
  System.out.println(birthDateString);

  //JOptionPane.showMessageDialog( null, outputMessage );


}

}

as u can see on one of the lines I have month-=1...well basically all I was doing was subtracting 1 from whatever month you put(number format September = 11 for example) so Java will take the 3 you enter for March which is wrong in java's view..it's two since January starts at 0.. and makes it fit Java's interpretation...all I need help with is the switch statement...can somebody help me. I 'll answer any questions about the program
Java Day of Birth Program
===

Ok so here's what I have so far..its a program that asks the user to enter the month,day,a dn year of birth in separate showInputDialog boxes. Basically what I'm having a problem with is I have to use a switch statement to express the day of the week as "Sunday", "Monday", and so on, instead of Java's regular interpretation 0,1, and so forth here's what I have

import java.util.GregorianCalendar;
import javax.swing.JOptionPane;   // Import JOptionPane from the swing class
import java.text.DateFormat;
public class FindDayOfBirth
{
 public static void main(String[] args)  //Main Method
 {

  // Declare and initialize variables


  String monthString, dayString,yearString;

  int month,day,year;

  monthString =JOptionPane.showInputDialog("Enter Month You were born in." );
  month = Integer.parseInt(monthString);         // Convert string into integer and stores the value  in age

  dayString = JOptionPane.showInputDialog("What's the day u were born on "); // Ask user for name of month
  day = Integer.parseInt(dayString);  // Convert string dayString into integer and store value in day.

  yearString = JOptionPane.showInputDialog("What's the year u were born on ");   // Ask user for numerical day born on
  year = Integer.parseInt(yearString);  // Convert string dayString into integer and store value in day.

  month-=1;
  GregorianCalendar birthYear = new GregorianCalendar(year,month,day);
  int birth = birthYear.get(GregorianCalendar.DAY_OF_WEEK);
  System.out.println( birth);
  switch (month)

  {
   //case 1: month = "January";
   //break;
   /*case 2: month = "February"
   case 3: month = "March"
   case 4: month = "April"
   case 5: month = "May"
   case 6: month = "June"*/
  }
  GregorianCalendar birthdate = new GregorianCalendar(year,month,day);
  long birthTime = birthdate.getTimeInMillis();
  DateFormat longDate = DateFormat.getDateInstance( DateFormat.LONG);
  String birthDateString = longDate.format(birthTime);
  System.out.println(birthDateString);

  //JOptionPane.showMessageDialog( null, outputMessage );


}

}

as u can see on one of the lines I have month-=1...well basically all I was doing was subtracting 1 from whatever month you put(number format September = 11 for example) so Java will take the 3 you enter for March which is wrong in java's view..it's two since January starts at 0.. and makes it fit Java's interpretation...all I need help with is the switch statement...can somebody help me. I 'll answer any questions about the program