Previous
0 / 18
Module DEMO-32-91DEMO-C-32

[Q5] Loan Approval Decision

DEMO-C-32 • Programming in C

Browser-only practice

Problem Statement

Write a program that determines a loan approval decision based on an applicant's monthly salary, years of service, and late payment history.

Loan Approval Rules

APPROVED: If the monthly salary is at least $600, the applicant has at least 2 years of service, and the applicant has no late payments.

REVIEW: If the monthly salary is at least $600, but the applicant has at least one late payment or has fewer than 2 years of service.

REJECTED: If the monthly salary is less than $600, regardless of years of service or late payment history.

Constraints

Monthly salary ≥ 0 Years of service ≥ 0 Late payment count ≥ 0

Input Format

Input consists of three whitespace-separated values on a single line:

  • A decimal number representing the monthly salary
  • An integer representing the years of service
  • An integer representing the late payment count

Output Format

Print exactly one line in the format:

Decision: [STATUS]

Where [STATUS] is either APPROVED, REVIEW, or REJECTED based on the rules above.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
900.0
5
0
Decision: APPROVED
Salary is at least 600, years of service is at least 2, and there are no late payments, so the decision is APPROVED.
Sample #2
Public sample
650.0
2
1
Decision: REVIEW
Salary is at least 600 and years of service is at least 2, but there is at least one late payment, so the decision is REVIEW.
Sample #3
Public sample
700.0
1
0
Decision: REVIEW
Salary is at least 600 and there are no late payments, but years of service is less than 2, so the decision is REVIEW.
Sample #4
Public sample
600.0
3
0
Decision: APPROVED
Boundary case: salary is exactly 600, years of service is at least 2, and there are no late payments, so the decision is APPROVED.
Sample #5
Public sample
599.9
5
0
Decision: REJECTED
Boundary case: salary is just below 600, so the decision is REJECTED regardless of years of service or late payments.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings