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

My program works great, except that I am having difficulty with the\"Input Speci

ID: 3613722 • Letter: M

Question

My program works great, except that I am having difficulty with the"Input Specification" part that is in the question below. Also,Under "Output Specification" it mentions about storing a number ofbacteria as a double, print it as an integer and casting it as avariable (It is highlighted in bold). This is what I do notunderstand with the double. If anyone can check my program to seeif it is in there and if not, if they can help me out with thisdouble thing and the "Input Specification."

Question:
One common task that the biology students must undertake iscultivating specimens of
bacteria. Typically, each day, the bacteria multiply at some givenrate. (For example, if
there are b bacteria at the beginning of the day, there will be1.1b bacteria at the end of
the day.) But, some of these bacteria, a constant number, also die.Thus, the formula for
figuring out how many bacteria are alive on day n+1 is based on howmuch bacteria are
alive on day n in the following manner:

f(n+1) = bf(n) – d

where f(n) represents the number of bacteria alive at the beginningof day n, b represents
the growth rate (a real number greater than 1), and d representsthe number of bacteria
that die each day.

The biology department would like you to write a program that takesin the following
information:
1) Number of bacteria on day 1
2) Growth rate
3) Number of bacteria that die each day
4) Number of days the bacteria will grow

And outputs a chart to the screen that shows how many bacteria willbe alive on each day.

Note: If the number of bacteria alive after replication is lessthan d, the number that are
supposed to die each day, then all remaining bacteria die. (Youcan’t have a negative
number of bacteria.)

Furthermore, in all cases, there is one of three outcomes:
1) The bacteria continue to indefinitely grow (well, in real lifethe lab will just kill them)
2) A steady state is achieved with the same number of bacteria eachday
3) The number of bacteria alive will eventually get down to 0.
You should also output which of these scenarios will happen.

Input Specification
1. The number of bacteria of day 1 will be a positive integer.
2. The growth rate will be a real number greater than 1 and lessthan 10.
3. The number of bacteria that die each day will be a positiveinteger.
4. The number of days the bacteria will grow will be a positiveinteger greater than 2 and
less than 100.

Output Specification

Output a chart with the following column headers:
Day Number of Bacteria
Each following line should have the following format:
d                  X
where d represents the day number of growing the bacteria, and Xrepresents the number
of bacteria alive at the beginning of that day.(You’ll need to store the number of bacteria
in a double, but print it out as an integer by casting thevariable. If necessary, ask your
instructor how to do this.)


After the chart, output a blank line and then output one of thefollowing statements:

The bacteria will eventually die out.
The bacteria will live in a steady state forever.
The bacteria will grow without bound.
depending on which of the three scenarios is accurate.

Sample Run:

How many bacteria are there on day one?
1000000
What is their growth rate?
1.1
How many bacteria die each day?
150000
How many days will you grow the bacteria?
5

Day          Number ofBacteria
1                  1000000
2                  950000
3                  895000
4                  834500
5                  767950

The bacteria will eventually die out.
______________________________________________________________________________

(MY WORK)

#include <stdio.h>

int main(void)
{
    int numb_bacteria, decay, day_bacteria, x;
    float growth;
   
    printf ("How many bacteria are there in a day? ");
    scanf ("%d", &numb_bacteria);
   
    printf ("What is their growth rate? ");
    scanf ("%f", &growth);
   
    printf ("How many bacteria die each year? ");
    scanf ("%d", &decay);
   
    printf ("How many days will you grow thebacteria? ");
    scanf ("%d", &day_bacteria);
   
    printf (" Day Number of Bacteria ");
   
    for ( x = 1; x <= day_bacteria; x++)
        {
           printf ("%d %d ", x, numb_bacteria);
           
           numb_bacteria = growth*numb_bacteria - decay;
        }
       
    if (growth*numb_bacteria > numb_bacteria +decay)
        printf (" The bacteriawill grow without bond");
    else if (growth*numb_bacteria < numb_bacteria+ decay)
        printf (" The bacteriawill eventually die out");
    else
        printf (" The bacteriawill live in steady state forever");
   
    getch ();
   
    return 0;
    }

Explanation / Answer

please rate - thanks #include #include int main(void) {     int day_bacteria=0,numb1_bacteria=0,x;     double decay=0,numb_bacteria=0,growth=0;        printf ("How many bacteria are there on day 1? ");     scanf ("%d", &numb1_bacteria);     while(numb1_bacteria
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote