473,805 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Consumer loan equation

21 New Member
Ok I've tried to google this but no luck their. I'm writing a program that calculates someones consumer loan. If we use $1000 as principle, and 15%(.15) as the rate and the duration of the loan is 18 months, you would in the end only get $775 because the the interest is deducted from the principle leaving you with 775$ from $1000. The user enters their own principle, rate, and time, and the program is suppose to calculate how much to request by adding an extra to the principle. For example: If I want a $1000 loan(15%int. 18 months duration) and the interest is taken out at the time of the loan I would only get $775. I need to come up with a number for them to request to get the $1000 loan they need. So does anyone know of an equation that I could use to calculate any principle, rate, time to come up with the requested loan amount they need to ask for. This is what I have so far:

#include <iostream>
using namespace std;

int main()
{
double Principle, Rate, Time, Total, Month;
char Answer;

cout.setf(ios:: fixed);
cout.setf(ios:: showpoint);
cout.precision( 2);

do
{
cout << "Enter the loan amount.\n";
cin >> Principle;
cout << "Enter the amount of the interest rate.\n";
cin >> Rate;
cout << "Enter the loan duration in months.\n";
cin >> Time;

Total = (((Principle * Rate) * (Time / 12) + Principle);
Month = Total / Time;

cout << "\nThe amount needed for the loan is $" << Total << endl;
cout << "The monthly payment is $" << Month << endl;
cout << "\nWould you like to calculate another loan amount.\n"
<< "Press y for yes, n for no,\n"
<< "and press return: ";
cin >> Answer;
}while( 'y' == Answer || 'Y' == Answer);

cout << "Goodbye!";

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

return 0;
}

Thank You for the help!
Jul 29 '07 #1
1 2433
weaknessforcats
9,208 Recognized Expert Moderator Expert
Normally you calculate the amount you wish to borrow based on a set rate and length of loan. The loan amount is just the borrowed amount plus the claculated interest.

Readthis.
Jul 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
8934
by: Stud Muffin | last post by:
Hey Basically, I'm trying to take objects created in microsoft word using equation editor (for creating clean looking math/physics equations) and putting them into some sort of webpage format. But they come out grossly unalligned and ugly when I try to directly copy and paste into microsoft frontpage 2000. Few things I could do is place them directly using x/y coord (which i don't know how to do), or just taking screenshots and use...
0
1414
by: Nogusta123 | last post by:
My web service has a single method called "CheckEligibility". This method can be used to check a person's eligibility for multiple products. Each product has different data requiements so each product has its own Data transfer Object that inherits from the base DTO used by the "CheckEligibility" method. I am using the attribute to make the product specific DTO's avaialble to the consumer. Also, the name of the particular objects...
8
11680
by: Agusta06 | last post by:
Greetings, I am working on writing a C++ program and am relatively new in doing so. I am finding computer programming interesting and enjoy learning how to write the source code. If anyone could take the time to aid me in writing my program I would be greatly appreciative. The purpose of this programming project is to write a C++ program to calculate a car loan payoff table to see how long it would take to pay off a car loan for a...
2
7893
by: phjones | last post by:
Need help programming mortagage calculator for 3 different loans 7 year, 15 year and 30 year. using java array I am a beginner with Java, This is what I have so far. Need to know if I am off the path, import java.math.*;//*loan calculator import java.text.*;//*formats numbers public class 3 Mortgage loans { // declare class variable array int mortgage calculator
1
9826
by: phjones | last post by:
please help resolve some error messages code is compling with errors see below the code. I am new at this please help! /** * @(#)3 Mortgage loans.java * * 3 Mortgage loans application * * Phyllis J Jones * Purpose to write a program in Java without a graphical user interface and have
4
11191
by: mps | last post by:
It seems to me that the MSDN code for synchronizing a producer and consumer thread at http://msdn2.microsoft.com/en-us/library/yy12yx1f.aspx is completely wrong. There is no reason to assume that each call to NewItemEvent.Set() will release a consumer thread (as explicitly mentioned in the AutoResetEven documentation), which means that the consumer threads won't necessarily know that there are items on the queue. Is this correct? Mike
2
4335
by: fatimahtaher | last post by:
Hi, I am new to C# programming and my first assignment requires me to calculate total interest paid on a loan. The user will input the loan, the interest rate per month, and the monthly payment. It has to use a while loop and calculate the following: Total amount of interest paid and the number of months to pay off the loan. I am not a finance major so I have some difficulty with the logistics of how to go about doing this. My code so...
6
14851
by: Trev17 | last post by:
Hello, I am new to C++ and i have tried for several hours to make a program my teacher has given me as a lab. Here is the Lab question: the roots of the quadratic equation ax^2 + bx + c = 0, a cannot equal 0 are given by the following formula -b + or - square root of (b^2 - 4ac) / 2a. If b^2 - 4ac = 0 then equation has a single root. if b^2 - 4ac > 0 then equation has two real roots. if b^2 - 4ac < 0 then equation has two complex...
10
2377
by: Constantine AI | last post by:
Hi i am having a little problem with an equation function that was created from all your help previously. The function works fine itself but with a small glitch within it. Here is the function code. Public Function fCalcEquation(strEquation As String) As Long Dim MyDB As DAO.Database Dim rstParameters As DAO.Recordset Dim intParamPosition As Integer Dim strParameter As String Dim strValue As String
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10617
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5545
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.