Calculate the day of the week for a particular date
I have to write this program to show what day of week you were born i wrote this code but i don't know what i have to do after :( :mad::confused:
• You will be using the JOptionPane object and the .showInputDialog method to prompt for user input. Prompt the user for a String object that represents a date in the mm/dd/yyyy format such as: 04/24/1982.
public class DayName
{
public static void main (String[]args){
// These are integer valuse
int iMonth=0;
int iDay=0;
int iYear=0;
int iCenturyYear =0;
// These are string values
String sDay;
String sMonth;
String sYear;
String sCenturyYear;
// Let the user to input their Date of Birth
sDay = JOptionPane.showInputDialog("Enter the day of your Birthday: ");
sMonth = JOptionPane.showInputDialog("Enter the month of your birthday: ");
sYear = JOptionPane.showInputDialog("Enter the month of your birthday: ");
// Convert string to integers
iMonth = Integer.parseInt(sMonth);
iDay = Integer.parseInt(sDay);
iYear = Integer.parseInt(sYear);
iCenturyYear=Integer.parseInt(sCenturyYear);
JOptionPane.showInputDialog("Enter the birth date (mm/dd/yyyy): ");
}// end main
}// end of the DayName class