Inspiration
include
include
include
float loanAmount,interestRate,Discount,i,loanPayment; //global variables
int years;
void loanDetails(void); //input from user regarding the loan float annualRate(void);// interest rate float discount(void); //discount to be added
int main() //main {
loanDetails(); //called three functions
annualRate();
discount();
loanPayment = (loanAmount)/(Discount); //formula for monthly payments
printf("\nthe monthly loan payment is %f",loanPayment);
return EXIT_SUCCESS;
}
void loanDetails(void) //taking input from user { printf("please enter Total Loan Amount: "); scanf("%f",&loanAmount); printf("please enter the number of years: "); scanf("%d",&years); printf("please enter the annualrate to be applied: "); scanf("%f",&interestRate); }
float annualRate(void) //calculated annual rate { float *ann; ann = &interestRate; i = ((*ann)/(100))/12; printf("the value for %d years is %f",years,i); return i; }
float discount(void) //calculated dicount
{
float *x,y;
x = &i;
y = 1 + *x;
int n = years*12;
float topD = (pow((y),n)-1);
float botD = (y-1)*pow((y),n);
Discount = topD/botD;
printf("\nthe value of discount is : %f",Discount);
return Discount;
}
What it does
loan calculator
How we built it
using c++
Challenges we ran into
Visualizing was an issue and calculating the amount was giving errors
Accomplishments that we're proud of
That it is buit succesfully .
What we learned
c++.
What's next for Loan Calculator Data visualization
github posting
Built With
- c++
- devc++
Log in or sign up for Devpost to join the conversation.