// Example program #include using namespace std; int main() { double a=1.3705,b=0.0119, prev_total=470 ,prev_new=147, total_cases, new_cases, gf; int m; cout << "Enter total number of days for which you want to calculate the values: "; cin >> m; cout << "Day | Previous Total | GF | New Cases | Total Cases on this day" << endl; for(int i=1; i<=m; i++) { gf = a - (b*i); new_cases = gf*prev_new; total_cases = (prev_total+new_cases); cout << i; cout << " | " << prev_total; cout << " | " << gf; cout << " | " << new_cases; cout << " | " << total_cases << endl; prev_total = total_cases; prev_new = new_cases; } } /* Day | Previous Total | GF | New Cases | Total Cases on this day 1 | 470 | 1.3586 | 199.714 | 669.714 2 | 669.714 | 1.3467 | 268.955 | 938.669 3 | 938.669 | 1.3348 | 359.001 | 1297.67 4 | 1297.67 | 1.3229 | 474.923 | 1772.59 5 | 1772.59 | 1.311 | 622.624 | 2395.22 6 | 2395.22 | 1.2991 | 808.851 | 3204.07 7 | 3204.07 | 1.2872 | 1041.15 | 4245.22 8 | 4245.22 | 1.2753 | 1327.78 | 5573 9 | 5573 | 1.2634 | 1677.52 | 7250.52 10 | 7250.52 | 1.2515 | 2099.42 | 9349.94 11 | 9349.94 | 1.2396 | 2602.44 | 11952.4 12 | 11952.4 | 1.2277 | 3195.01 | 15147.4 13 | 15147.4 | 1.2158 | 3884.49 | 19031.9 14 | 19031.9 | 1.2039 | 4676.54 | 23708.4 15 | 23708.4 | 1.192 | 5574.44 | 29282.9 16 | 29282.9 | 1.1801 | 6578.39 | 35861.2 17 | 35861.2 | 1.1682 | 7684.88 | 43546.1 18 | 43546.1 | 1.1563 | 8886.03 | 52432.2 19 | 52432.2 | 1.1444 | 10169.2 | 62601.3 20 | 62601.3 | 1.1325 | 11516.6 | 74117.9 21 | 74117.9 | 1.1206 | 12905.5 | 87023.4 22 | 87023.4 | 1.1087 | 14308.3 | 101332 23 | 101332 | 1.0968 | 15693.4 | 117025 24 | 117025 | 1.0849 | 17025.7 | 134051 25 | 134051 | 1.073 | 18268.6 | 152319 26 | 152319 | 1.0611 | 19384.8 | 171704 27 | 171704 | 1.0492 | 20338.5 | 192043 28 | 192043 | 1.0373 | 21097.2 | 213140 29 | 213140 | 1.0254 | 21633 | 234773 30 | 234773 | 1.0135 | 21925.1 | 256698 31 | 256698 | 1.0016 | 21960.2 | 278658 32 | 278658 | 0.9897 | 21734 | 300392 33 | 300392 | 0.9778 | 21251.5 | 321644 34 | 321644 | 0.9659 | 20526.8 | 342170 35 | 342170 | 0.954 | 19582.6 | 361753 36 | 361753 | 0.9421 | 18448.7 | 380202 37 | 380202 | 0.9302 | 17161 | 397363 38 | 397363 | 0.9183 | 15759 | 413122 39 | 413122 | 0.9064 | 14283.9 | 427406 40 | 427406 | 0.8945 | 12777 | 440183 41 | 440183 | 0.8826 | 11277 | 451460 */