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

I am not getting the required output. This is the required output: How many jack

ID: 3641484 • Letter: I

Question

I am not getting the required output.

This is the required output:

How many jackalopes do you have?
How many generations do you want to wait?
If you start with 200 jackalopes and wait 1 generations,
you will end up with a total of 204 jackalopes.

This is what I have:

#include<iostream>
using namespace std;
int main()
{
const int BIRTHRATE=3;
const int DEATHRATE=1;
int nb,nd,c=0,ng,jn;
cout<<"How many jackalopes do you have? ";
cin>>jn;
cout<<"How many generations do you want to wait? ";
cin>>ng;
while(ng!=0)
{
nb=jn*BIRTHRATE/100;
nd=jn*DEATHRATE/100;
jn=jn+nb-nd;
c++;
ng--;
}
cout<<"If you start with " << jn << "and wait " << c << "generations, you will end up witha total of " << nb << "jackalopes. ";
}

Explanation / Answer

Sorry, ignore the other answer, it has some code that Visual Studio included Here is what you want: #include using namespace std; int main() { const int BIRTHRATE=3; const int DEATHRATE=1; int nb,nd,c=0,ng,jn; coutjn; int original = jn; coutng; while(ng!=0) { nb=jn*BIRTHRATE/100; nd=jn*DEATHRATE/100; jn=jn+nb-nd; c++; ng--; } cout
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