b310 has asked for the wisdom of the Perl Monks concerning the following question:
Thanks for all the help.## Calculates the maximum monthly total housing payment (income / debt +) ## my $ratioincome28 = 0; my $ratioincome33 = 0; my $ratiodebt36 = 0; my $ratiodebt38 = 0; $ratioincome28 = $totalincome * .28; $ratioincome33 = $totalincome * .33; $ratiodebt36 = ($totalincome * .36) - $totaldebt; $ratiodebt38 = ($totalincome * .38) - $totaldebt; ## Determines the lower of the two ratios ## my $totalpmt = 0; if ( ($ratioincome33 gt $ratiodebt38) && ($downpercent eq 20) ) { $totalpmt = $ratiodebt38; } elsif ( ($ratioincome33 lt $ratiodebt38) && ($downpercent eq 20) ) { $totalpmt = $ratioincome33; } elsif ( ($ratioincome28 gt $ratiodebt36) && ($downpercent lt 20) ) { $totalpmt = $ratiodebt36; } else { $totalpmt = $ratioincome28; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Elsif Clause Problem
by neniro (Priest) on May 10, 2004 at 15:30 UTC | |
by b310 (Scribe) on May 10, 2004 at 15:44 UTC | |
by flyingmoose (Priest) on May 10, 2004 at 15:51 UTC | |
|
Re: Elsif Clause Problem
by pbeckingham (Parson) on May 10, 2004 at 16:19 UTC | |
by b310 (Scribe) on May 10, 2004 at 17:46 UTC | |
|
Re: Elsif Clause Problem
by talexb (Chancellor) on May 10, 2004 at 17:23 UTC | |
|
Re: Elsif Clause Problem
by pbeckingham (Parson) on May 10, 2004 at 16:03 UTC | |
|
Re: Elsif Clause Problem
by zude (Scribe) on May 10, 2004 at 16:09 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |