Hey again guys and gals,
getting a really weird error when i attempt to print out doubles
in my program i have to store several double values, but when ever i print then out all i get is
-9.25596e+061 instead of what should be printed out.
string line;
stringstream stream;
cout << "Please Enter the Mortgage Ammount:" << endl;
getline(cin,line);
stream << line;
stream >> mortgageAmmount;
cout << "Please Enter the Mortgage Term in Years: " << endl;
getline(cin,line);
stream << line;
stream >> mortgageTerm;
cout << "Please Enter the Interest Rate: " << endl;
getline(cin,line);
stream << line;
stream >> interestRate;
thats the code that receives the input mortgageTerm, interestRate and mortgageAmmount are all stored as doubles.
cout << "Mortgage Ammount: " << mortgageAmmount << " GBP" << endl
<< "Mortgage Term: " << mortgageTerm << " Years" << endl
<< "Interest Rate: " << interestRate << "%" << endl
is the code that prints out the data.
in my test run i entered
mortgageAmount as 20,000
mortgageTerm -9.25596e+061
interestRate -9.25596e+061
and it prints out
mortgageAmount as 20,000
mortgageTerm 20
interestRate 5.5
thanks in advance for any help
-Midi