Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9221137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:30:42+00:00 2026-06-18T03:30:42+00:00

I cannot figure out the logical equation/math on how to figure out what amount

  • 0

I cannot figure out the logical equation/math on how to figure out what amount a person would qualify at for a loan and the number of years it would take. The text in bold below is where I’m stuck. Any ideas would be appreciated, including formula suggestions.

Complete program specification:

Inputting the customer’s annual income, number of years of the loan (loan period), the amount of the loan (the loan amount), and the customer’s status (P for Preferred or R for Regular). Approve the loan if the customer meets either of the following conditions. For a Regular customer – the loan amount divided by the number of months in the loan period <= to10% of the customer’s monthly income. Or, if the customer is a preferred customer, the loan amount divided by the number of months in the loan period <= 1% of the customer’s annual income. Output approval or disapproval.

What I can’t figure out:

If the loan is disapproved (2) tell the customer the maximum amount the loan could be based on current income (3) how long the period (round up to the nearest whole year) would have to be to approve the loan at the current income.

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{

double income, preferred_validation, regular_validation, years, loan_amount, monthlyIncome, annualIncomeTest, max_amount, request_amount;
char status;

cout<<"Please enter the annual income of the customer: ";
cin>>income;

cout<<"\nPlease enter the number of years of the loan: ";
cin>>years;

cout<<"\nPlease enter the amount of the loan: ";
cin>>loan_amount;

cout<<"\nCustomer status: P - Preferred R - Regular."<<endl;

cout<<"Please enter the customer's status: ";
cin>>status;

if(status != 'P' || 'R')
{
    status='R';

    cout<<"\n\nThe customer status code you input does not match one of the choices.\nThe calculations that follow are based on the applicant being a Regular customer."<<endl;
}


if(status=='R')
{


regular_validation=loan_amount/(years*12);
monthlyIncome=((income/12)*.10);


if(regular_validation<=monthlyIncome)
{
    cout<<"\nThis loan is approved.";
}
else
{
    cout<<"\nThis loan is disapproved.";
}

}
else if(status=='P')
{

    preferred_validation=loan_amount/(years*12);
    annualIncomeTest=income*.01;

    if(preferred_validation<=annualIncomeTest)
    {
        cout<<"\nThis loan is approved.";
    }
    else
    {
        cout<<"\nThis loan is disapproved."<<endl;

        max_amount=???;

        cout<<"As a preferred customer, the largest loan you qualify for is "<<max_amount<<" or you can get the requested amount of "<<loan_amount<<" by increasing the loan period to "<<years<<" years.";
    }

}
else
{
    cout<<"Restart and enter your customer status.";
}






cin.get();
cin.get();

return 0;

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:30:44+00:00Added an answer on June 18, 2026 at 3:30 am
    if(status != 'P' || 'R')
    

    Should be:

    if(status != 'P' && status != 'R')
    

    Obviously you reject the loan when preferred_validation <=annualIncomeTest`, then max_amount should be annualIncomeTest?

    max_amount= annualIncomeTest;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot figure out how to get GAS to emit line number debugging information
I cannot figure out what would happen in the following scenario: class MBase {
I cannot figure out how to pass the text from a <SelectListItem> with a
I have something of a logical puzzle I can not figure out. I have
Cannot figure out, where to change EOF in PyCharm. My scripts start with :
I cannot figure out this positioning problem in Firefox. It doesn't seem to follow
I cannot figure out why this doesn't work. It seems so simple. It should
I cannot figure out how to write the following query using the DbFinderPlugin 1.2.2
I cannot figure out why I get this error during check-in. I checked in
I cannot figure out how to convert this code from C# to VB.net. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.