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

hi I need a c++ program for this but done simply please Crazy Pet Store Backgrou

ID: 3836238 • Letter: H

Question

hi I need a c++ program for this but done simply please
Crazy Pet Store

Background:

The local pet store has 35 different bowls with fish in them arranged in a circle in the “fish room.”  The first six have goldfish, the next seven have guppies, the next nine have angel fish, the next eight have goldfish, and the last five hold tiger fish.  As the bowls vary in size, the number of fish that are in each bowl at the start of the day also varies.  The count of fish in each bowl is as follows:

Bowls 1 – 3: 15 fish

Bowls 4 – 7: 8 fish

Bowl 8: 19 fish

Bowls 9 – 12: 16 fish

Bowls 13 – 22: 14 fish

Bowls 23 – 24: 31 fish

Bowls 25 – 29: 9 fish

Bowls 30 – 33: 26 fish

Bowls 34 – 35: 8 fish

Houston…We have a Problem:

A trained seal finds its way into the store.  The seal begins to eat fish in the following manner.

a. It walks over to bowl #1.

b. It counts four bowls and then eats a fish (the first fish it eats comes from bowl #4 and it’s a goldfish).

c. It again counts four, starting with the next available bowl, and eats a fish (the second fish it eats comes from bowl #8 and it’s a guppy.

Method:

The conditions that controls the seal are:
a. If there are no fish left in a bowl, the seal does not count the bowl and skips it and goes to the next bowl containing fish.  (It starts counting four from the bowl it ate from.)

b. The bowls are arranged in a circle, there is no last bowl.

c. After the seal eats a bowl #35, it counts over 4 bowls and finds itself at bowl #4.  (Bowl #3 if four bowls away from 34, etc.)

d. The seal continues to eat until 361 fish are consumed.

Your Task:

You are to write a C++ program that will calculate and report the following (put breaks in so the user can read):

The number and type of fish in each bowl before the seal begins eating.

The total number of each type of fish before the seal begins to eat.

The number and type of fish left in each bowl after each time the seal eats.

The total number of each type of fish remaining after the seal eats.

Explanation / Answer

// Note: Please do thumbsup if you like the solution

#include<iostream>
using namespace std;

/*
The number and type of fish in each bowl before the seal begins eating.
The total number of each type of fish before the seal begins to eat.
The number and type of fish left in each bowl after each time the seal eats.
The total number of each type of fish remaining after the seal eats.
*/


void fishLeft(int fish[])
{
   for (int i = 1; i <= 35; i++)
   {
       if ((i >= 1 && i <= 6) || (i>=23 && i<=30))
       {
           cout << "Bowl " << i << " contains " << fish[i] << " gold fish" << endl;
       }

       if (i >= 7 && i <= 13)
       {
           cout << "Bowl " << i << " contains " << fish[i] << " guppies fish" << endl;
       }

       if (i >=14 && i <= 22)
       {
           cout << "Bowl " << i << " contains " << fish[i] << " angel fish" << endl;
       }

       if (i >= 31 && i <= 35)
       {
           cout << "Bowl " << i << " contains " << fish[i] << " tiger fish" << endl;
       }
   }
}

void sumFish(int fish[])
{
   int guppiesCount = 0;
   int angelfishCount = 0;
   int goldfishCount = 0;
   int tigerfishCount = 0;

   for (int i = 1; i <= 6; i++)
   {
       goldfishCount+= fish[i];
   }

   for (int i = 7; i <= 13; i++)
   {
       guppiesCount+= fish[i];
   }

   for (int i = 14; i <= 22; i++)
   {
       angelfishCount+= fish[i];
   }

   for (int i = 23; i <= 30; i++)
   {
       goldfishCount+= fish[i];
   }

   for (int i = 31; i <= 35; i++)
   {
       tigerfishCount+= fish[i];
   }
   cout << " ";
   cout << "Numbers of gold fish are: " << goldfishCount << endl;
   cout << "Numbers of guppies fish are: " << guppiesCount << endl;
   cout << "Numbers of angel fish are: " << angelfishCount << endl;
   cout << "Numbers of tiger fish are: " << tigerfishCount << endl;
}

void printFishes(int fish[])
{
   cout <<" ";
   for (int i = 0; i <= 35; i++)
   {
       cout << fish[i] << " ";
   }
}


void fillFishes(int fish[])
{
   for (int i = 1; i <= 3; i++)
   {
       fish[i] = 15;
   }

   for (int i = 4; i <= 7; i++)
   {
       fish[i] = 8;
   }
  
   fish[8] = 19;

   for (int i = 9; i <= 12; i++)
   {
       fish[i] = 16;
   }

   for (int i = 13; i <= 22; i++)
   {
       fish[i] = 14;
   }

   for (int i = 23; i <= 24; i++)
   {
       fish[i] = 31;
   }

   for (int i = 25; i <= 29; i++)
   {
       fish[i] = 9;
   }

   for (int i = 30; i <= 33; i++)
   {
       fish[i] = 26;
   }

   for (int i = 34; i <= 35; i++)
   {
       fish[i] = 8;
   }
}


void eatFishes(int fish[])
{
   int i = 1;
   int index = 1;
   int count = 0;
   while (count <361)
   {
       if (index > 35)
       {
           index = 0;
       }
       if (fish[index] > 0)
       {
           if (i == 4)
           {
               count++;
               fish[index]--;
               i = 1;
               index++;
               fishLeft(fish);
               //printFishes(fish);
           }
           else
           {
               i++;
               index++;
           }
       }
       else
           index++;
   }
   //cout << "Value of count is: " << count;
   //printFishes(fish);
   //sumFish(fish);
   return;
}

int main()
{
   int fish[36] = { 0 }; // 0 - 35
   for (int i = 0; i <= 35; i++)
   {
       cout << fish[i]<< " ";
   }
   cout << endl;

   fillFishes(fish);
   //printFishes(fish);
   fishLeft(fish);
   sumFish(fish);
   eatFishes(fish);
   sumFish(fish);
   getchar();
}