27. double getPayAmount() { double result; if (_isDead) { // Get the dead amount result = getAmount1(); } else { if (_isSeparated)) { // Get the separated amount result = getAmount2(); } else { if (_isRetired) { // Get the retired amount result = getAmount3(); } else { // Get the normal amount result = getAmount4(); } } } return result; }
28. double getPayAmount() { if (_isDead) return deadAmount(); if (_isSeparated) return separatedAmount(); if (_isRetired) return retiredAmount(); return normalPayment(); }