#include using namespace std; void main() { cout << "This program calculates the green crud population by\n" << "processing user input.\n"; char choice; const int time_period = 5; int days, growth_period, base_weight, sum = 0; do { cout << "\nWould you like to run green crud population program?\n" << "Press y for yes, or n for no, then press Enter key."; cin >> choice; if ((choice == 'y') || (choice == 'Y')) { cout << "\nEnter the number of whole days the green crud population will spread: "; cin >> days; cout << "\nEnter the initial weight of the green crud in pounds: "; cin >> base_weight; growth_period = days/time_period; if (growth_period == 0 || growth_period == 1) { // Assigns sum equal to base weight since green crude has not had enough time to grow sum = base_weight; cout << "\nThe " << base_weight << " pounds of green crude will be\n" << sum << " pounds of green crud after " << days << " days\n" << "due to " << growth_period << " growth periods.\n\n"; } else { int fib1 = base_weight; int fib2 = base_weight; int sum = 0; for (int count = 2; count <= growth_period; count++) { sum = fib1 + fib2; fib1 = fib2; fib2 = sum; } cout << "\nThe " << base_weight << " pounds of green crude will be\n" << sum << " pounds of green crud after " << days << " days\n" << "due to " << growth_period << " growth periods.\n\n"; } } else cout << "\nThank you for using program.\n"; } while ((choice == 'y') || (choice == 'Y')); } /* This program calculates the green crud population by processing user input. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 4 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 10 pounds of green crud after 4 days due to 0 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 5 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 10 pounds of green crud after 5 days due to 1 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 10 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 20 pounds of green crud after 10 days due to 2 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 15 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 30 pounds of green crud after 15 days due to 3 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 20 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 50 pounds of green crud after 20 days due to 4 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 25 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 80 pounds of green crud after 25 days due to 5 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 30 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 130 pounds of green crud after 30 days due to 6 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 35 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 210 pounds of green crud after 35 days due to 7 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.y Enter the number of whole days the green crud population will spread: 40 Enter the initial weight of the green crud in pounds: 10 The 10 pounds of green crude will be 340 pounds of green crud after 40 days due to 8 growth periods. Would you like to run green crud population program? Press y for yes, or n for no, then press Enter key.n Thank you for using program. Press any key to continue . . . */