#include <cmath>
#include <iostream>
using namespace std;
//Function prototypes
void getPrice (float&);
void getInterestRate (float&, float&, float&);
void getDownPayment ( float&);
void gettradeIn (float&);
void calcmonPayment (float, float, float, float, float, float&);
int main()
{
// Input variables
float price;
float downPayment;
float tradeIn;
float loanAmt;
float annualIntRate;
float annualIntPercent;
float monIntRate;
float noMos;
float monPayment;
int count;
// get price
getPrice(price);
// get interest rate
getInterestRate (annualIntRate, annualIntPercent, monIntRate);
while (count < price)
{
getDownPayment(downPayment);
gettradeIn (tradeIn);
calcmonPayment (price, downPayment, tradeIn, noMos, loanAmt, monPayment );
cout << "\n\nprice of vehcile is" << monPayment << "per month\n\n";
monPayment = annualIntRate / 12.0;
count++;
}
cin.get(); // Wait for keypress before exiting.
cin.get(); // Wait for keypress before exiting.
return 0;
}
// get price of vehicle
void getPrice (int & price)
{
while ( price < 50000.00|| price > 0)
{
cout << "Enter the price of the Vehicle: ";
cin >> price;
if (price > 50000.00)
cout << "Enter a price less than 50.\n";
if (price < 50.00)
cout << "Enter a price less that 50000.\n";
}
return;
}
// get tile size in inches
void getInterestRate( float& annualIntRate, float& annualIntPercent,
float& monIntRate);
{
while (annualIntRate >= 0 || annualIntRate > .50)
{
cout << "Enter the annual interest rate in decimals ";
cin >> annualIntRate;
if (.50 < annualIntRate < 0)
cout << "Enter a number less than .50 and greater than 0.\n";
}
return;
}
}
// getdownPayment: Prompts the user for the downPayment
void getdownPayment(float& downPayment);
{
bool dataInvalid = true; // Start with invalid data to begin the while loop
// Get our downPayment
//
while(dataInvalid)
{
cout << "enter the down payment ";
cin >> downPayment
if (downPayment < 0)
{
cout << "------ Positive Values Only, reenter data. --------\n";
dataInvalid = true;
{
dataInvalid = false;
}
}
dataInvalid = true; // Start off invalid so the loop will execute
// Get our down payment check for errors
while(dataInvalid)
}
return;
}
// get trade in value
void gettradeIn( float& tradeIn);
{
while (tradeIn >= 0)
{
cout << "Enter the value of the trade in ";
cin >> tradeIn;
if ( annualIntRate < 0)
cout << "Enter a number greater than 0.\n";
}
return;
}
// calculate the monthly payment for vehicle
void calcmonPayment(float price, float downPayment, float tradeIn,
float noMos, float monPayment, float loanAmt);
{
// Convert feet to inches
monIntRate = (annualIntRate) / 12.0;
annualIntPercent = (annualIntRate) * 100.0;
loanAmt = ((price) – (downPayment) – (tradeIn));
monPayment = (loanAmt * monIntRate)/(1 –(1 + monIntRate) -pow(noMos);
noMos = 24, 36, 48, 60;
return;
}
that is the code I have been working on.
here are the errors
1. warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
2. error C2447: '{' : missing function header (old-style formal list?)
3.: error C2059: syntax error : '}'
4 : error C2143: syntax error : missing ';' before '}'
5 : error C2059: syntax error : '}'
6: error C2447: '{' : missing function header (old-style formal list?)
7: error C2447: '{' : missing function header (old-style formal list?)
8 error C2447: '{' : missing function header (old-style formal list?)
9: error C3209: ' ' : Unicode identifiers are not yet supported
10: error C3209: ' ' : Unicode identifiers are not yet supported
11: error C3209: '(1' : Unicode identifiers are not yet supported
It is suppose to ask for the price, interest rate, down payment, trade in, and then give them monthly payment for 24 \, 36, 48, 60;mos
I have hit a brick wall any help is appriciated on getting this code worked out. Thanks!!!
Emily