i need a program about loan approval or rejection ..
but i really don't have any idea to do it ..
can any 1 help me ?

it need to get the user income..
get the user loan commitment..
get the user outstanding credit card..

it calculate how many years they wants pay back for the new loan .. and monthly payment (with interest)..

it need to calculate how much the user need to pay for the old loan commitment and outstanding credit card per month..

at last calculate monthly payment for
new loan+old loan+ outstanding credit card balance= x
x is less than 1/3 of salary then the loan approve.. else reject

Member Avatar for jencas

Nobody here will do your homework. Try it for yourself and present us the code if you have problems.

Nobody here will do your homework. Try it for yourself and present us the code if you have problems.

;( that is my homework ..
but i really dunno how to start at all..*sad
i try to do ..
i need forum's friends to help ..
thanks

I know there is many problem about my problem..
it have no error .. but it cannot run
my c++ version is borlan5.02
any i can help me to correct it ?

my program
--------------------------------------------------------------------------------------
#include <iostream.h>
#include <math.h>
#include <stdlib.h>

double monthly_income() ;
double Loan ();
double outstanding_credit_card_balance ();
double loan_commitment ();

double amount,monthly_payment ;
double income;
double mininum_credit_card_balance ;
int number, x;
double sum_loan_commitment;

void main ()
{
double sum_overall;

double monthly_income() ;
double loan() ;
double outstanding_credit_card_balance () ;
double loan_commitment () ;

sum_overall= monthly_payment+mininum_credit_card_balance+sum_loan_commitment ;

if(sum_overall<= income/3)
{
cout<<"The Loan Is Approve.";
}
else
{
cout<<"The Loan is Rejected.";
}

}


double monthly_income()
{

cout<< "Please enter your montly income." ;
cin>>income;

return income;
}

double loan()
{

int year ;
cout<< "Please enter amout that you want to loan in RM.\n";
cin>>amount ;
cout<<"\nPlease enter the years you want to pay back.\n" ;
cin>>year ;
//Assume the interest is 5%
monthly_payment=(amount/(year*12))*1.05 ;
cout<<"Your roughly monty payment for your loan is " <<monthly_payment<<endl;

return monthly_payment;
}

double outstanding_credit_card_balance()
{

cout<<"Please enter your mininum payment for your outstanding credit card payment in RM .\n";
cin>>mininum_credit_card_balance;

return mininum_credit_card_balance;
}


double loan_commitment ()
{

#define max_column 100
double loan_commitment[max_column] ;

cout<<"Please enter number of your loan commitment.\n" ;
cin>>number ;

for ( x=1; x<=number; x++)
{
cout<<"The monthly payment of the loan commitment "<<x<<" is" ;
cin>>loan_commitment[x];
}

for (x=1; x<=number; x++)
{
sum_loan_commitment=+loan_commitment[x] ;
}

return sum_loan_commitment ;
}

--------------------------------------------------------------------------------------
END

Welcome to the board/community! When posting code please use code tags as discussed in the watermark in the Message box, or in the announcement section at the top of the board. This will preserve the indentation you use (hopefully) when writing code. Without the indentation many of the more experienced people who frequent this site won't look at your code and you may miss valuable opportunities for assistance.

You compiler should be able to handle the use of namespaces and up to date header files. It is to your distinct advantage to use them. That would change your header files to iostream instead of iostream.h, etc. You will need to include material from namespace std either by writing an using statement of by using the scope operator.

Your program so far doesn't need a header file other than iostream.

Don't use void as the return type for main(). It's not standard. Your compiler will handle int as the return type without a problem.

Don't redeclare the following functions in main():
double monthly_income() ;
double loan() ;
double outstanding_credit_card_balance () ;
double loan_commitment () ;

If you want to call the functions leave the double off the front of each line above.

Minimize use of global variables. Make them local if at all possible.

Your functions return type double. Storing the return values in local variables for later use is best. Right now you are ignoring the return values because you are using global variables. If you really want to do that, then use type void for the function return values, though that is no the best solution.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.