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

Suppose you\'re a biologist who\'s tracking the population of Smurfs in a partic

ID: 3537809 • Letter: S

Question

Suppose you're a biologist who's tracking the population of Smurfs in a particular area. ( If you're not familiar with Smurfs, they are blue, vaguely disturbing humanoid creatures with strangely shaped heads. For unknown reasons, they reside inside mushrooms.) Your data indicates that 73 Smurfs were sighted in May, 80 in June, 75 in July and 64 in August.


Write a program that goes through each month ( starting from June ), using relational operators to determine and display whether or not there was an increase in the Smurf population from the previous month. Also display the amount by which the Smurf population changed from the previous month. This amount can be a positive or a negative number depending on whether the population increased or decreased.

Explanation / Answer

Month represented by M1 prior month , M2 current month.... This will be in some sort of a pseudo code:


M1-M2=result;

If (result < 0)

   print " Increase in population = ", abs(result);

else

    print" decrease in pupulation = ", result*(-1)=result;


// M1 - M2 an increase, result will be a negative value a decrease result will be a positive value but you need to display a negative to show a decrease.

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