I have no experience at all in c++, and this is my first program. Ican\'t seem t
ID: 3616907 • Letter: I
Question
I have no experience at all in c++, and this is my first program. Ican't seem to know what to do. Heres the problem:You have been asked to calculate the populations of rabbitsand wolves over a 1000-day period with population counts every 25days only. The program must request from the program user theinitial numbers of rabbits and wolves. The following formulas areto be used for calculating the day-to-day changes in the rabbit(R)and wolf(W) populations:
R(tomorrow) = (1+a)*R(today)-c*R(today)*W(today) W(tomorrow = (1-b)*W(today)+c*d*R(today)*W(today)
Where: a=.01 b=.005 c=.00001 d=.01 Finally, as summary information print both the highestindividual daily population number of wolves and of rabbits overthe 1000-day period.
The teacher has her own guidelines. Which are: -The number of iterations(1000 days) must be defined as a"program defined constant integer". Values of a,b,c, and d must bedefined as constants also. -The program must use a "counter-control repetition" structurethat loops 1000 times. Within the loop, using today's value for Rand W, compute the corresponding tomorrow values for R and W.Display corresponding pairs (R and W for today and tomorrow) ofdata only for every 25 days. -use a selection structure (if statement) to identify a 25thiteration and then display on the monitor population values -use selection structures (if statements) to determine thehighest number of individual daily population if both wolves andrabbits over the 1000-day period to be displayed as summaryinformation. -code the following sequence statements as the first actionlines (after your variable definitions) in your main function forformatting real number outputs to 5 decimal places: cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(5);
Any help would be appreciated.
You have been asked to calculate the populations of rabbitsand wolves over a 1000-day period with population counts every 25days only. The program must request from the program user theinitial numbers of rabbits and wolves. The following formulas areto be used for calculating the day-to-day changes in the rabbit(R)and wolf(W) populations:
R(tomorrow) = (1+a)*R(today)-c*R(today)*W(today) W(tomorrow = (1-b)*W(today)+c*d*R(today)*W(today)
Where: a=.01 b=.005 c=.00001 d=.01 Finally, as summary information print both the highestindividual daily population number of wolves and of rabbits overthe 1000-day period.
The teacher has her own guidelines. Which are: -The number of iterations(1000 days) must be defined as a"program defined constant integer". Values of a,b,c, and d must bedefined as constants also. -The program must use a "counter-control repetition" structurethat loops 1000 times. Within the loop, using today's value for Rand W, compute the corresponding tomorrow values for R and W.Display corresponding pairs (R and W for today and tomorrow) ofdata only for every 25 days. -use a selection structure (if statement) to identify a 25thiteration and then display on the monitor population values -use selection structures (if statements) to determine thehighest number of individual daily population if both wolves andrabbits over the 1000-day period to be displayed as summaryinformation. -code the following sequence statements as the first actionlines (after your variable definitions) in your main function forformatting real number outputs to 5 decimal places: cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(5);
Any help would be appreciated.
Explanation / Answer
please rate-thanks //#include //using namespace std; #include int main() {double a=.01,b=.005,c=.00001,d=.01; int wolf,rabbit,i,maxw,maxr; coutrabbit; coutwolf; maxw=wolf; maxr=rabbit; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.