CS46A Fall 19

6A

Complete the class, HomeLoanProcessor, an application for a home loan that will be used by a loan officer. Below are some made-up criteria to determine if the loan is granted. These qualifications are for some fictitious place - not the Bay Area!

A loan is granted based on the amount of the loan, annual household income, and the number of years a person has lived at the current address. The loan is granted if

Hint: it will simplify your code if you set a boolean variable granted to false and only change it to true if a set of conditions is true.

HomeLoanProcessor has a constructor that takes the loan amount, annual household income, and the number of years a person has lived at the current address

public HomeLoanProcessor(double loanAmount, double annualIncome, int yearsAtCurrentAddress)The parameters must be positive. If only one of them is not positive, set all 3 to 0.

It has these methods

Provide Javadoc

Use nested ifs for loanGranted. There are other ways to do this, but I want you to use nested ifs. You should have 3 outer if clauses (if / else if / else)

For the draft, provide the constructor, and implement the getAnnualIncome() and setAnnualIncome() methods. Implement setLoanAmount and loanGranted as stubs. Note that a stub with return type boolean returns false. Provide the Javadoc. The Javadoc should document the code that will do in the final not what it does in the draft.

6A draft:
6A final:

6B

Write an application called LoopsAndMore which gets valid input

Instructions updated Oct 6 to match Codecheck

Requirement for one loop removed Oct 7

For the draft: Do the first two steps

6B draft:
6B final:

6C

Complete the class StringsAndLoops which has a constructor that takes a String of text. Implement the following methods.

Provide Javadoc

For the draft, provide the instance variable, constructor, getText() and getUpperCaseCount() methods along with the necessary Javadoc

6C draft:
6C final: