CTGT
« been wroking on a loan »

Welcome Guest. Please Login or Register.
Dec 28, 2009, 6:25pm




CTGT :: Code Center :: The Coding Desk :: been wroking on a loan
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: been wroking on a loan (Read 365 times)
[Mb]
Administrator
*****
i got hit by the w0obug...
member is offline



Coder.



Joined: Apr 2006
Gender: Male
Posts: 186
Location: Perth, Western Australia
Karma: 8
 been wroking on a loan
« Thread Started on Aug 2, 2006, 3:52pm »

iv been working on a loan calculator i have made this because i want to sse what tha banks really charge for browing money

//Include the Iostream and CMath file
#include <iostream>
#include <cmath>

//start main function
int main() {

//declare variables to be used
unsigned long loanAmount = 20000;
float annualInterestRate = 7.0;
unsigned short loanLength = 10;
const unsigned short MONTHS_IN_YEAR = 12;
bool approved = false; // approved for a loan

// preform the calculations
float monthlyInterestRate = annualInterestRate / MONTHS_IN_YEAR;

monthlyInterestRate = monthlyInterestRate/100;

unsigned short numberPayments = loanLength * MONTHS_IN_YEAR;

//Start calculation monthly payments
float monthlyPayment = 1 - pow((1 + monthlyInterestRate),
-numberPayments);
monthlyPayment = monthlyInterestRate/monthlyPayment;
monthlyPayment = loanAmount * monthlyPayment;

//print information

std::cout << "Assuming a loan in the amount of $" << loanAmount
<< ", at " << annualInterestRate << "% interest over "
<< loanLength << " years the monthly payment would be $";



//formatt numbers
std::cout.setf(std::ios_base::fixed);
std::cout.setf(std::ios_base::
showpoint);
std::cout.precision(2);
std::cout << monthlyPayment << " \n\n ";

//show if they are approved
std::cout << "According to our infomation you are";
std::cout << " (approved) ?";
std::cout << " already approved for this loan\n";

// make new line
std::cout << "\n";

//let user no what to do next
std::cout << "PRESS ENETR OR RETUEN TO CLOSE THE APP ";
std::cin.get();

return 0;
}


its still is not finshed but im getting there that is just the main shell so far
Link to Post - Back to Top  IP: Logged
John
Full Member
***
member is offline





Joined: Jun 2006
Gender: Male
Posts: 152
Karma: 0
 Re: been wroking on a loan
« Reply #1 on Aug 2, 2006, 10:44pm »

i could make one of those in JS in a couple hours :P...

Very cool though i could'nt make one in C++ tho..
Link to Post - Back to Top  IP: Logged

[image]
Charismatic Enigma
Administrator
*****
member is offline

[avatar]

[yim] [msn] [aim]

Joined: Apr 2006
Gender: Male
Posts: 952
Location: Watford, UK
Karma: 2
 Re: been wroking on a loan
« Reply #2 on Aug 3, 2006, 9:57am »

Hope its finished soon :D
Link to Post - Back to Top  IP: Logged


My 1st Post - 29/03/06 10:14
My 100th post - 23/05/06 18:38
My 500th Post - 07/06/06 19:35


   [Search This Thread][Send Topic To Friend] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!