Question: don't repeat yourself 1 point possible (graded) public static int dayof Year (int month, int dayOfMonth, int year) if (month == 2) { dayOfMonth +
don't repeat yourself 1 point possible (graded) public static int dayof Year (int month, int dayOfMonth, int year) if (month == 2) { dayOfMonth + 31; } else if (month=3){ dayOfMonth +59; } else if (month == 4){ dayOfMonth + 90; > else if (month -- 5) { dayOfMonth +31 + 28 +31 + 30; } else if (month = 6) { dayOfMonth + 31 + 2 + 31 + 30 + 31; } else if (month -- 7) { dayo.Month += 31 + 28 +31 +30 +31 + 30; } else if (month) { dayOfMonth +- 31 + 28 +31 + 30 +31 +30 + 31; } else if (month = 9) { dayOfMonth += 31 + 28 + 31 + 30 + 31 +30 + 31 + 31; } else if (month 10){ dayofMonth += 31 + 28 +31 +30 +31 +30 +31 +31 + 30+ } else if (month - 11) { dayot Month + 31 + 28 +31 +30 +31 +30 +31 +31 + 30 + 31; > else if (month - 12) { dayof Month + 31 + 28 + 31 + 30 +31 +30 +31 +31 + 30 + 31 - 31; 3 return dayofMonth: } Some of the repetition in day of Year() is repeated values. How many times is the number of days in April 1 Submit don't repeat yourself part 2 don't repeat yourself, part 2 1 Dose ordedi One reason why repeated code is bad because a problem in the rated code has to be lived in my plates, not just one suppose our calendar changed to that obrusy altya 10 days of How many numbers in this code have to be changed Sulmil don't repeat yourself, part 3 bolnegade Another kind of repetition in this codeis day the Assume you have an array It month the new 30.1.10.31) Which of the following code sieletons could be used to be the code out enough to that daytoothe appears only once? Check ithatody for litt month wwilchmonte care treakce break-1 while mcmonth-m- of monthebedayofar month 1. dworth, wat
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
