import javax.swing. JOptionPane; public class ex10_2 public static void main(String[] args) ( String strIn; int nYear,nMonth,nNumOfDays=0; strIn=JOptionPane.showInputDialog(,,year.); nYear=Integer.parseInt(strIn); if(nYear<0) System.out.println("Invalidate number of year!") return; strIn=JOptionPane.showInputDialog("month.); nMonth=Integer.parseInt(strIn); if(_____________) System.out.println("Invalidate number of month!" return;
switch(nMonth) case 1: case 3: case 5: case 7: case 8: case 10: case 12: nNumOfDays=31; break; case 4: case 6: case 9: case 11: nNumOfDays=30; break; case 2: if(________________) nNumOfDays=29; else nNumOfDays=28; break; System.out.println("Number of days:"+ nNumOfDays);