I am working on a programming challenge from "Starting Out With C++: Early Objects, 10th Edition". I have the code about halfway done, but the output isn't coming out how it is supposed to be, and I am wondering how to fix it. I have it attached here and the desired output.
#include <iostream>
using namespace std;
int main()
{
    float starting_num_of_organisms,
        average_daily_population_increase,
        size_of_daily_population;
    int num_of_days_to_multiply;
    cout << "Enter Starting Population: ";
    while (!(cin >> starting_num_of_organisms) || starting_num_of_organisms < 2) {
        cout << "Invalid. Population must be 2 or greater.";
        cout << "Enter starting population: ";
        cin.clear();
        cin.ignore(123, '\n');
    }
    cout << "Enter positive daily growth % (.1 must be entered as 10): ";
    while (!(cin >> average_daily_population_increase) || average_daily_population_increase < 0) {
        cout << "Invalid. Daily Population Growth \n"
             << " must be greater than 0. \n"
             << "Enter Daily Population Growth (%): ";
        cin.clear();
        cin.ignore(123, '\n');
    }
    average_daily_population_increase *= .01;
    cout << "Enter number of days to calculate: ";
    while (!(cin >> num_of_days_to_multiply) || num_of_days_to_multiply < 1) {
        cout << "Invalid. Number of days must not be less\n"
             << "than 1. Enter number of days to calculate: ";
        cin.clear();
        cin.ignore(123, '\n');
    }
    for (int i = 0; i < num_of_days_to_multiply; i++) {
        cout << "Population size for day " << (i + 1);
        cout << ": " << starting_num_of_organisms
             << endl;
        starting_num_of_organisms += (starting_num_of_organisms * average_daily_population_increase);
    }
    return 0;
}
Here is the current output:
Enter Starting Population: 896.896
Enter positive daily growth % (.1 must be entered as 10): 2.785
Enter number of days to calculate: 8
Population size for day 1: 896.896
Population size for day 2: 921.875
Population size for day 3: 947.549
Population size for day 4: 973.938
Population size for day 5: 1001.06
Population size for day 6: 1028.94
Population size for day 7: 1057.6
Population size for day 8: 1087.05
The desired output is something like this below. The numbers are just for reference, and do not have to be specific to those numbers.
Enter starting population (greater than 2): 896.896
Enter positive daily growth % (.1 must be entered as 10): 2.785
Enter number of days to calculate (greater than 1): 8
----------------------------------
Start Population: 896.90
Daily Percent Growth: 2.79%
Number of Days: 8
Day           Start   End
              Popl.   Popl.
----------------------------
1           896.90    921.87
2           921.87    947.55
3           947.55    973.94
4           973.94   1001.06
5          1001.06   1028.94
6          1028.94   1057.60
7          1057.60   1087.05
8          1087.05   1117.33
 
     
    