Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

THE UNIVERSITY OF MINDANAO

Matina Campus, Davao City

Name: Trexie Maarat Onting Year and Program: I-BSCE


Year and Program: I-BSCE Laboratory Activity no: 1

LOAN CALCULATOR
Source Code
#include<iostream>
#include<iomanip>
#include<conio.h>
#include<windows.h>

using namespace std;

int main()
{
float amort, L_Amount;
float interest, terms, A, bal;
system ("cls");

cout << "-----------------------------------------------------------------------------------------"<< endl;


cout << " Name : Trexie M. Onting \t\t\t\t Date : Feb. 21 , 2022";
cout << "\n Course : BSCE - 1ST YEAR MAJOR IN STRUCTURAL \t\t Subject : EDP
101L - 6644 \n";
cout << "-----------------------------------------------------------------------------------------";
cout << "\n\n\t\t\t\t\t LABORATORY PROJECT \n\n";
cout <<
"_________________________________________________________________________________
________";

cout << "\n\n LOAN CALCULATOR";


cout << "\n\n Loan Amount : ";
cin >> L_Amount;
loop:
cout << "\n Interest Rate per Month in Percent (1/2/3 only): ";
cin >> interest;
if (interest < 1 || interest > 3)

{
cout << "\n Interest Rate not in the Range";
Sleep(200);
goto loop;
}
loop2:
cout << "\n Terms in months (12/24/36 only) : ";
cin >> terms;
if (terms != 12 && terms != 24 && terms != 36 )
{
cout << "\n Terms you inputted are not Available";
Sleep(200);
goto loop2;
}

interest = interest/100;
A = L_Amount*(1 + (terms*interest));

cout<<"\n Total Amount to be Paid : "


<<setprecision(2)
<<fixed
<<showpoint
<<A << endl;

amort = A / terms;
bal = A - amort;
cout<<"\n Monthly Amortization : "<<amort;
cout<<"\n\n No. of Months Monthly Payment Balance";

for(int x = 1; x <= terms; x++)


{
cout<<"\n\t"<< x <<"\t\t "<< amort <<"\t\t "<< bal;
bal = bal-amort;
Sleep(250);
}

cout << "\n\n\t\tTHAT'S ALL, THANK YOU !!! ";

return 0;
}
FLOWCHART

Start

float amort, L_Amount;


float interest, terms, A,
bal;
int x = 1;

Display the following


“LOAN CALCULATOR”
“Loan Amount:”

cin>>input

Loan Interest Rate per


Month are 1, 2, and 3
percent only:

cin>>input

if (interest !=1
&& interest!=3 Interest Rate not in the
&& interest!=2) Range

Display “Terms in months available


are 12, 24, and 36 only:”
“Select term:”

cin>>input

if (terms != 12 &&
terms != 24 && Terms you inputted are
terms != 36 ) not Available x++

bal = bal-amort
Print Total Amount to be Paid

amort=A/terms; Print x amort bal


bal = A-amort;

Print No. of Months Monthly


Int
Payment Balance x<=36
x=1

End

You might also like