Hey Everyone this is my first post so I'll get the Intro's out of the way. I'm Kendra and I'm 21 years old and I'm a new Computer Programming Major. I'm halfway through my first semester as this major. I spent 2 years in College as a Nursing Major only to find out , after my Mothers death, that I do not want to be a Nurse lol I've always loved computers but everything that I know up to this point is self taught. I live in a small town and no one here does this kind of stuff so I'm somewhat on my own. I've been doing well in my classes (which are all ONLINE) but, C++ has been somewhat of a Pain in my Butt lol My other Programming classes are great.
SO, here is my problem. I'm having to create a program using While loops. The purpose of the program is to calculate monthly car payments for the user. I'm not allowed to use any Global Variables. I'm also not allowed to use functions so I have to use a Linear-straight-line program. My problem lies in the monPayment I keep getting this error.* error C2064: term does not evaluate to a function taking 1 arguments* I'm confused as to how I would get the monPayments to calculate correctly, given that the number of months (noMonths) has to be either 24, 36, 48 & 60.
My output should eventually look something like this;
Vehicle Price : 99999.99
Trade in Value : 99999.99
Down Payment : 99999.99
Loan Amount : 99999.99
Annual Interest Rate 99.99%
Monthly Payment Options
24 mo 99999.99
36 mo 99999.99
48 mo 99999.99
60 mo 99999.99
#include <iostream> //Access Cout
#include <cmath> //Access Power Functions
#include <iomanip> //Access Manipulators
using namespace std;
float price; //Price of vehicle
float downPayment; //Down Payment
float tradeIn; //Trade in for vehicle
float loanAmt; //Loan Amount (calculated)
float annualIntRate; //Annual Interest Rate (fraction)
float annualIntPercent; //Annual Interest Rate (percent)
float monIntRate; //Monthly Interest Rate (fraction)
int noMonths; //Number of MonthlyPayments
(24,36,48 & 60)
float monPayment; //Monthly Payment
//Prompt User for Input.
// Get Price.
cout << " Enter Price of Vehicle: ";
cin >> price;
// Get Interest Rate.
cout << " Enter Annual Interest Rate; ";
cin >> annualIntRate;
// Get Down Payment.
cout << " Enter Down Payment in dollars and cents: ";
cin >> downPayment;
// Get Trade In .
cout << "Enter trade-in in dollars and cents: ";
cin >> tradeIn;
while(price >= 50000.00);
if ((tradeIn >= price)&&(downPayment >= price - tradeIn))
loanAmt = price - tradeIn - downPayment;
monIntRate = annualIntRate / 12.0;
annualIntPercent = annualIntRate * 100.0;
loanAmt= price - downPayment - tradeIn;
monPayment=(loanAmt*monIntRate)(1.0 -(1 + monIntRate)-noMonth);
cout << fixed << "Price of Vehicle: " << setprecision(2) << price << endl << "Trade in Value : " << setprecision(2) << tradeIn << endl
<< "Down Payment : " << setprecision(2) << downPayment << endl << "----------------------" << endl << "Loan Amount : " << setprecision(2) <<loanAmt <<endl << "Interest Rate : " << setprecision(2) << annualIntPercent << "%" << endl;