chaitanya raj budumuru


{ City } srikakulam
< Country > india
* Profession * assistant prof.
User No # 20170
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 10
Users Marked my Answers as Wrong # 5
Questions / { chaitanya raj budumuru }
Questions Answers Category Views Company eMail




Answers / { chaitanya raj budumuru }

Question { Adtran, 6892 }

What are the techniques you use for debugging?


Answer

By pressing F8 key then there's a window appears and there
we have to write all the variables that we had used so far
in the programme and press enter then the initial values of
those variables taken as garbage if the variable not
assigned any value or the assigned value will be displayed
at bottom of the code seperated by a line.
By pressing F8 Key continuesly debugging will be
happened and somme times output screen also will appear and
the values of variables also changed according to the logic.
This is the debugging process in c++ as well as c also.

Is This Answer Correct ?    5 Yes 5 No

Question { 5388 }

If P is the population on the first day of the year, B is
the birth rate, and D is the death rate, the estimated
population at the end of the year is given by the formula:

The population growth rate is given by the formula:
B – D
Write a program that prompts the user to enter the starting
population, birth and death rates, and n, the number of
years. The program should then calculate and print the
estimated population after n years. Your program must have
at least the following functions:
1. growthRate: This function takes its parameters the
birth and death rates, and it returns the population growth
rate.
2. estimatedPopulation: This function takes its
parameters the current population, population growth rate,
and n, the number of years. It returns the estimated
population after n years
Your program should not accept a negative birth rate,
negative death rate, or a population less than 2.


Answer

#include
#include

class population
{
int b,d,p,n,c;
public:
void read()
{
c=1;
do
{
if(c>1)
{
cout<<"\n\nYou are entered wrong input";
cout<<"\nPress Enter And Re-Enter The Input";
getch();
c++;
}
clrscr();
cout<<"Enter The Birth and Death Rates:\n\t\t";
cin>>b>>d;
cout<<"\n\nEnter The current population:\n\t\t";
cin>>p;
cout<<"Enter How many Years Estimated:\n\t\t";
cin>>n;
}while(b<0&&d<0&&p<2);
}
int growth_rate(int b,int d)
{
return(b-d);
}
int estimatedPopulation(int p,
int growthrate(b,d),
int n)
{
for(int i=1;i<=n;++i) p=p+growthrate(b,d);
return p;
}
void execute()
{
read();
cout<<"The Population after"< < }
};

void main()
{
clrscr();
population pop;
pop.execute();
getch();
}

Is This Answer Correct ?    5 Yes 0 No