'How can I form a table with this code to give me a list of outputs?

I was trying to make a table that shows the different rates of the population of pigeons over a certain amount of time. So far, it only gives the max and min population over the interval rather than a table. For example for the input you could put 1.5 for the initial and 2.0 for the final. When the code runs, it only gives the amount of pigeons over that time, and the highest and lowest population(Or it's supposed to). I am trying to get a full table to represent the rate of change in the population. Any help?

#include<iostream> //Required for cout prog 4_5! 

#include<cfloat> //required for DBL_MAX 

#include<cmath> 

#include<iomanip> 

using namespace std; 
int main() 

{ 
double maxRate, minRate(DBL_MAX),PercentRate,klast,kfirst,kinc,k(-1.6);  //Declare and initialize objects 

cout << "Hello User! This program will be calculating the different rates of the pigeon population in New York City.";
cout << "You will now be prompted to enter the needed values of time for the program to calculate. Using the range of 0 to 3, please enter the Initial Time of years in a decimal.";
cin >> kfirst;
cout << "Next, the final time";
cin >> klast;
cout << "And finally, enter the increment of time 0.1";
cin >> kinc;
int loops; 
  
cout << "  minRate  maxRate  PercentRate ";
cout<< scientific <<setprecision(3);


for (int i = 1;  i<=loops ; ++i);
loops=int(klast-kfirst)/kinc+1;
{ 

PercentRate=2*sin(kinc)*(k*pow(kinc,3)-5.2*pow(kinc,2)+27*kinc-4.1); 
  
if (PercentRate < minRate) 

{ 

minRate = PercentRate; 

} 

if (PercentRate > maxRate) 

{ 

    maxRate=PercentRate; 

} 

k=k+kinc;
cout << setw(10) << maxRate  << setw(10) << minRate << setw(10) << PercentRate << endl;

} 

//Output of rate change of pigeons 

cout << "The minimum rate of pigeons in New York City is " << minRate; 

  

cout << "The maximum rate of pigeons in New York City is " << maxRate; 

return 0; 

} 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source