Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Find and correct six errors in the program. The errors can be both syntax and lo

ID: 3566380 • Letter: F

Question

Find and correct six errors in the program.

The errors can be both syntax and logical

// This program predicts the population size of the organisms // by the initial population, the value of increase, and the // number of days the population is observed #include using namespace std; int main() { int number, increase, days; cout << "Enter the starting number of organisms" << endl; cin >> number; cout << "Enter the average daily increase (in %)" << endl; cin >> increase; cout << "Enter the number of days" << endl; cin >> days; populationSize(startingNumber,DailyIncrease,numberOfDays); //This function should display the number of organisms on each day void populationSize(int startingNumber, int dailyIncrease, int numberOfDays); { int count=startingNumber; for (int i=1;i<=numberOfDays) { count+=dailyIncrease*count/100; } cout << "On day " << i << " there will be " << count << " organisms" << endl; } }

Explanation / Answer

#include <stdio.h>
#include<iostream.h>
//using namespace std;
//populationSize(startingNumber,DailyIncrease,numberOfDays);

int main()
{
   int number, increase, days;
   cout << "Enter the starting number of organisms" << endl;
   cin >> number;
   cout << "Enter the average daily increase (in %)" << endl;
   cin >> increase;
   cout << "Enter the number of days" << endl;
   cin >> days;

   //populationSize(startingNumber,DailyIncrease,numberOfDays);
   //This function should display the number of organisms on each day
   void populationSize(int startingNumber, int dailyIncrease, int numberOfDays);
   {
    int startingNumber,numberOfDays,dailyIncrease;
       int count=startingNumber;
       for (int i=1;i<=numberOfDays;i++)
       {
           count+=dailyIncrease*count/100;
       }
       cout << "On day " << i << " there will be " << count << " organisms" << endl;
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote