I'm writing a program for my intro to comp science class, here is the problem:

Write a program that the initial population =.45 (in thousands) k = 4 and you calculate the population over 10,000 years. Find how many years have a population of [0 to .1], [.1 to .2], [.2 to .3] ... [.8 to .9] and so on...

Here is what I have...

I am getting an "Illegal use of floating point in function main ()" error, anyone have any ideas? Thanks!Code:#include <iostream> using namespace std; int main() { cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(3); double initial_pop; // pop size this year double population; // pop size next year int k; // no idea what this is int years = 0; while (population >= 0) { years = years + 1; if (years <= 10000 ) { population = (k*(initial_pop) - k*(initial_pop)^2); cout << years<<"\t"<<population << endl; } else { population = (k*(initial_pop) - k*(initial_pop)^2); cout << years<<"\t"<<population << endl; } } cout << "Enter any key to terminate the program." << endl; char dummy; cin >> dummy; return 0; }