Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

COBOL. The LENDER Bank The LENDER Bank offers mortgages on homes valued up to $5

ID: 3824095 • Letter: C

Question

COBOL. The LENDER Bank

The LENDER Bank offers mortgages on homes valued up to $500,000. The required down payment is calculated as follows:

4% of the first $60,000 borrowed

8% of the next $30,000 borrowed

10% of the rest

The amount borrowed cannot exceed 50% of the value of the house.

Write an interactive program (no environment division) to accept input from

the keyboard that specifies for each borrower the amount that he or she wishes to borrow along with the price at which the house is valued. Based on the data entered, display the following:

1. A message that indicates if the amount the user wishes to borrow is acceptable (no more than 50% of the house value).

2. A message that indicates if the value of the house is acceptable (does not exceed $500,000).

3. A message displaying the required down payment, if the amount to be borrowed is acceptable.

When the amount to be borrowed is not acceptable, the program must not calculate or display therequired down payment.

For example, let’s assume that a borrower wants a loan for $100,000 on a house valued at $200,000. The maximum amount that can be borrowed is $100,000 (50% of $200,000) and as such the requested amount is acceptable. Therefore, the program should display a message indicating that the requested amount is acceptable and another message indicating that value of the house is also acceptable. The program should also indicate that the required down payment is $5,800 (60,000 x 4% + 30,000 x 8% + 10,000 x 10%).

Please note that the program must only indicate the down payment amount, numbers in parenthesis are provided for illustrative purposes.

However, if the requested amount was greater than $100,000 (such as $100,001), the program must display a message indicating that the requested amount is not acceptable because it exceeds 50% of the value of the house, must display a message indicating that the value of the house is acceptable, and must not display or calculate the down payment. Also, if the value of the house is greater than $500,000, the program must display a message indicating that the value of the house is not acceptable as it exceeds the maximum allowable amount.

Explanation / Answer

Below program is an idea of how can you implement this. Modify as per your requirement.

Update: IDENTIFICATION DIVISION.

PROGRAM-ID. CA3P2.
AUTHOR.
INSTALLATION.
DATE-WRITTEN. APR.24,2017.
DATE-COMPILED.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT CUSTOMER-MASTER ASSIGN TO 'A3P2.MST'
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD CUSTOMER-MASTER.
01 MASTER-REC.
05 IDENT-OUT PIC X(34).
05 HOME-VALUE-OUT PIC 999999.
05 AMT-TO-BORROW-OUT PIC 999999.
05 PERCENT-OUT PIC V99.
WORKING-STORAGE SECTION.
0
Update 2: 300-TOO-HIGH.
IF HOME-VALUE-IN > 500000
DISPLAY 'HOME VALUE IS TOO HIGH FOR MORTGAGE'
END-IF.
****************************************...
* Determines if borrowed amount is greater than 50% of home *
* value *
****************************************...
400-LOAN-AMT.
IF AMT-TO-BORROW-IN > HOME-VALUE-IN/2
DISPLAY ' AMOUNT BORROWED EXCEEDS 50% OF HOME VALUE'
DISPLAY ' LOAN AMOUNT IS NOT ACCEPTABLE'
END-IF.
****************************************...
* Determines if borrowed amount is acceptable *
****************************************...
500-LOAN-AMT.
IF AMT-TO-BORROW-IN <= HOME-VALUE-IN/2
DISPLAY ' LOAN AMOUNT IS ACCE
****************************************...
* Determines the downpayment *
****************************************...
77 DOWN-PAYMENT   PIC 9(6).

IF AMT-TO-BORROW-OUT > 60000
   IF AMT-TO-BORROW-OUT > 100000
       COMPUTE DOWN-PAYMENT = 4800 + 0.10 * (AMT-TO-BORROW-OUT - 100000 )
   ELSE
       COMPUTE DOWN-PAYMENT = 2400 + 0.08 * (AMT-TO-BORROW-OUT - 60000)
ELSE
   COMPUTE DOWN-PAYMENT = 0.04 * AMT-TO-BORROW-OUT.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote