Sei sulla pagina 1di 3


1) Consider the following pseudocode program:

Y := X
IF X<0 then
Y := -Y
Suppose X and Y are integer variables with initial values X0 and Y0.
a. Describe what the program does (i.e., what its function is) in words and give the final values of the
variables it references in terms of their initial values. (5 pts)
The program gets the possible value of any number  the program computes the absolute value of any
b. Is the program correct? Briefly explain your answer. (5 pts)
No program specifications were provided so it is impossible to tell if this is really the program that the user
wants. Thus given this limited information, it is not possible to tell if the program was done correctly or not

2) The following is an example which demonstrates how banks process loans. Present the logic of this
business process using a flowchart or a decision tree
At a local bank, loan officers must evaluate loan applications before approving or denying them. During the
evaluation process, many factors regarding the loan request and the applicant’s background are considered. If
the loan is for less than $2,000, the loan officer checks the applicant’s credit report. If the credit report is rated
good or excellent, the loan officer approves the loan. If the credit report is rated fair, the officer checks to see if
the applicant has an account at the bank. If the applicant holds an account, the application is approved;
otherwise, the application is denied. If the credit report is rated poor, the application is denied. Loan
applications for amounts between $2,000 and $200,000 are divided into four categories: car, mortgage,
education, and other. For car, mortgage, and other loan requests, the applicant’s credit report is reviewed and
an employment check is made to verify the applicant’s reported salary income. If the credit report rating is
poor, the loan is denied. If the credit report rating is fair, good, or excellent and the salary income is verified,
the loan is approved. If the salary income is not verifiable, the applicant is contacted and additional
information is requested. In this case, the loan application along with the additional information is sent to the
vice president for review and a final loan decision. For educational loans, the educational institution the
applicant will attend is contacted to determine the estimated cost of attendance. This amount is then compared
to the amount of the loan requested. If the requested amount exceeds the cost of attendance, the loan is denied.
Otherwise, education loan requests for amounts between $2,000 and $34,999 are approved if the applicant’s
credit rating is fair, good, or excellent. Education loan applications requesting amounts from $35,000 to
$200,000 are approved only if the credit rating is good or excellent. All loan applications for amounts greater
than $200,000 are sent to the vice president for review and approval

The loan processing system requires the loan officer to check on several items:
a) Loan amount (LA)
i) < $2,000
ii) $2,000<=LA<=$200,000
iii) LA > $200,000
b) Type of loan
i) Car, Mortgage, or Other
ii) Educational
c) Credit Report
i) Excellent
ii) Good
iii) Fair
iv) Poor
d) Account Holder
i) Yes
ii) No
e) Salary Verifiable
i) Yes
ii) No
f) Loan Amount vs Cost of Education
i) Loan Amount > Cost of education
ii) Loan Amount <= Cost of education
g) Educational Loan Amount
i) $2000<=EducLA<=$34,999
ii) $35,000<=EducLA<=$200,000

The loan officer actions can be any of the following

a) Approve the Loan
b) Deny the Loan
c) Get additional information
d) Send to VP for further review

We can immediately visualize the bank loan processing system using flowcharts or decision trees. The flowchart
is shown below

Note that if there are incomplete details in the description of the loan processing system, the business analyst or
QA may
o make assumptions but for verification of end users
o raise questions to be answered by end users
These discrepancies must be raised and clarified with end users in order to avoid getting wrong interpretations.

For the loan processing system, the BA/QA must clarify these missing details with the loan officer in order to
reflect the true and accurate picture of the loan processing system.
In the loan processing description, no information re action of the loan officer was given for the following
scenarios hence the BA/QA must verify with loan officer if the following assumptions are correct
o Assumption 1: Applicant requests for an educational loan in an amount between $2,000 and $34,999
and credit report is poor. The result is Deny Application.
o Assumption 2: Applicant requests for an educational loan in an amount between $35,000 and
$200,000 and credit report is either fair or poor. The result is Deny Application.

Another way to visualize a process is to use a decision tree. For the given loan processing system, the decision
tree is shown below

Here the BA/QA did not make any assumptions but instead placed a question mark on items which were not
reflected in the provided loan processing system description. Again these issues should be raised with the loan
officer so they themselves would provide the correct and complete steps for processing loan applications.

The decision tree provides a better visualization of the paths and hence is a better tool for constructing
corresponding test cases.

Can you tell how many test cases there are from the decision tree shown above?

We can also create a decision table corresponding to the loan processing system