Enter a day of a year to determine the day of the year?
Package WZS. arithmetics; import java. util. threads;/*** question: enter a day of a month to determine the day of the year? * @ Author wwx154783 **/public class test_wzs13 {public static void main (string [] ARGs) {system. out. println ("Enter year, month, day"); input = new partition (system. in); int year = input. nextint (); // year int month = input. nextint (); // month int day = input. nextint (); // day int sum = 0; // total int temp = 0; // indicates the leap year // calculates the monthly date and switch (month) {Case 1: sum = 0; break; Case 2: Sum = 31; break; Case 3: Sum = 59; break; Case 4: Sum = 90; break; Case 5: Sum = 120; break; Case 6: Sum = 151; break; Case 7: Sum = 181; break; case 8: sum = 212; break; Case 9: Sum = 243; break; case 10: Sum = 273; break; Case 11: Sum = 304; break; Case 12: Sum = 334; break; default: system. out. println ("date error. "); break;} // calculates the total number of days sum = sum + Day; // If (Year % 400 = 0 | (Year % 4 = 0 & year % 100! = 0) {temp = 1;} else {temp = 0;} If (temp = 1 & month> 2) {sum ++;} system. out. println (Year + "year" + month + "month" + day + "is the day of this year" + sum +. ");}}