Refactoring In-Class Assignment
Refactoring In-Class Assignment
Do as much of this assignment as you can in the time remaining for class. You may work
with one other person to do this assignment. Each pair should submit only one set of
answers through the drop box on blackboard. REMEMBER TO PUT YOUR NAMES
IN THE FILE NAME AND INSIDE THE FILE. If you have completed all the
questions before the scheduled end of class, you may leave early.
String getOfficeAreaCode() {
return _officeAreaCode;
}
String getOfficeNumber() {
return _officeNumber;
}
import junit.framework.*;
return -1;
}
}
3. Simplify the following conditionals:
a. if !(_currentMonth != 2)
if (((_currentYear mod 4 == 0) && (_currentYear mod 100 != 0))
|| (_currentYear mod 400 == 0)) {
//it’s a leap year
!(_graduateStudent || _childOfRichAlumnus)
fail();