[ create a new paste ] login | about

Link: http://codepad.org/4Wcepkyy    [ raw code | output | fork ]

C++, pasted on Oct 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
// prog03.cpp           put your name here             Simple interest
#include <iostream> 
using namespace std;
int main() 
{
float P, R, T, I;
P = $1200.00;
R = 8.5%;
T = 12;
I = P * R * T;
cout << "the interest of a principle of" << P << " with an interest rate of " << R << " over " << T << "months is " << I << endl;
return 0;
}


Output:
1
2
3
4
Line 4: error: '$' in identifier or number
In function 'int main()':
Line 7: error: '$1200' was not declared in this scope
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: