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

The LENDER Bank The LENDER Bank offers mortgages on homes valued up to $500,000.

ID: 3889069 • Letter: T

Question

The LENDER Bank The LENDER Bank offers mortgages on homes valued up to $500,000. The required down payment is calculated as follows: 10% of the first $60,000 borrowed 7.5% of the next $30,000 borrowed 5% of the rest The amount borrowed cannot exceed 50% of the value of the house. Write a fully interactive COBOL program (no environment division) that accepts input from the user 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 the required 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 the value of the house is also acceptable. The program should also calculate and indicate that the required down payment is $8,750 (60,000 x 10% + 30,000 x 7.5% + 10,000 x 5%). Please note that the program must only indicate the down payment amount, numbers in parenthesis are provided for illustrative purposes. However, if the loan amount requested 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. Based on the previous discussion, the program requirements are as follows: 1. Create the Pseudocode for the program. Save the file as LastnameFirstinitialA6.docx (e.g., BasilioEA6.docx) or LastnameFirstinitialA6.pdf (e.g., BasilioEA6.pdf). Review pages 18, 22, and 142-153 to gain a better understanding and to ensure that your pseudocode includes all pertinent information. It is expected that the pseudocode submitted for this assignment will contain the necessary details to accurately reflect the program’s logic. 2. Code the COBOL program and name the source file as LastnameFirstinitialA6.cbl (e.g., BasilioEA6.cbl). 3. Include comments describing the purpose of the program and to provide the required class identifying information. 4. The PROGRAM-ID section of the IDENTIFICATION DIVISION must be written as LastnameFirstinitialA6 (e.g., BasilioEA6). 5. Use extended ACCEPT and DISPLAY statements or SCREEN SECTION to capture input from the user and display output to the user. 6. The program shall continue accepting data from the user until the user indicates that there is no more data.

Explanation / Answer

*cobol program for messaging to accept or not accept loan

IDENTIFICATION DIVISION.
PROGRAM-ID. HOUSELOANCHECK.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 loanamt PIC S9(6)V9(2).
01 res pic s9(6)v9(2).
01 tmp1 pic s9(6)v9(2).
01 tmp2 pic s9(6)v9(2) value 0.0.
01 husval PIC S9(6).
01 RANG PIC S9(6) VALUE 500000.

PROCEDURE DIVISION.
DISPLAY "Enter Loan amount you want?: "
ACCEPT loanamt
DISPLAY "Enter House value for loan?: "
ACCEPT husval
IF husval < RANG THEN
DISPLAY 'the value of the house is acceptable because it not exceeds the maximum allowable amount $500000.'
  
else
DISPLAY 'the value of the house is not acceptable because it exceeds the maximum allowable amount $500000.'stop run
end-if
divide husval by 2 giving res
IF loanamt <= res THEN
DISPLAY ' the amount the user wishes to borrow is acceptable '
  
else
  
DISPLAY ' the amount the user wishes to borrow is not acceptable because amount more than 50% of the house value'
  
stop run
end-if
move husval to tmp1
IF tmp1>=60000 then
DISPLAY res
subtract 60000 from tmp1 giving tmp1.
MULTIPLY 60000 BY 0.04 GIVING res.
add tmp2 to res giving tmp2.
display res

else
MULTIPLY tmp1 BY 0.04 GIVING res.
add tmp2 to res giving tmp2
end-if
if tmp1>=30000 then
subtract 30000 from tmp1 giving tmp1.
MULTIPLY 30000 BY 0.08 GIVING res.
add tmp2 to res giving tmp2
else   
MULTIPLY tmp1 BY 0.08 GIVING actloan.
add tmp2 to res giving tmp2
end-if
if tmp1>0 then
MULTIPLY tmp1 BY 0.1 GIVING res.
add tmp2 to res giving tmp2
DISPLAY "the required down payment is $"tmp2
STOP RUN.

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