Question

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>

#include <cmath>


using namespace std;
//Declaration of Functions

double percentToNormal(double percent);

int main()
{
    double a;
    int principle;
    double percentRate;
    double rate;

    int numberOfDays;
    cout << "How much money did you start with? " << endl;
    cin >> principle >> endl;

    cout << "How much money do you expect to make? " << endl;
    cin >> percentRate >> endl;

    cout << "How many days would you like to keep your money? " << endl;
    cin >> numberOfDays >> endl;


    rate = percentToNormal(percentRate);

    for(int day=1;day<=numberOfDays; day++){
        a = principle * pow(1+rate, day);
        cout << day << " --------- " << a << endl;


    }

return 0;

}

// Custom Functions
double percentToNormal(double percent)
{
        double rate;

        rate = (percent/100);
        return rate;

}


Hey Guys I'm new to the forum. I'm getting this error: no match for operator >> in std::cin, on line 20 (cin >> principle >> endl;). I think it applies for all cins. What am I doing wrong?
You appear to be trying to input some data and store it in endl. That seems insane. endl is for outputting.
lol! Thanks I removed it and its working now! Sorry for the stupid question ^_^
Topic archived. No new replies allowed.