Note that there are some explanatory texts on larger screens.

plurals
  1. POcalculations in function seem to be ignored, same number returned always
    primarykey
    data
    text
    <p><strong>growthRate function:</strong> (as of 8:00 PM 12/11/2010)</p> <pre><code> #include "header.h" float growthRate (float birthRate, float deathRate) { float growthrt; growthrt = (birthRate) - (deathRate); cout &lt;&lt; growthrt &lt;&lt; endl; return growthrt; } </code></pre> <p><strong>estimatedPopulation function:</strong> (as of 8:00 PM 12/11/2010)</p> <pre><code>#include "header.h" float estimatedPopulation (float currentPopulation, float years, float birthRate, float deathRate) { int x; float newPopulation; for (x = 0; x &lt; years; x++) { newPopulation = currentPopulation + currentPopulation * (growthRate (birthRate, deathRate) / 100); currentPopulation = newPopulation; cout &lt;&lt; newPopulation &lt;&lt; endl; } return newPopulation; } </code></pre> <p><strong>output function:</strong>(as of 8:00 PM 12/11/2010)</p> <pre><code>#include "header.h" void output (float currentPopulation, float years) { cout &lt;&lt; estimatedPopulation (currentPopulation, years) &lt;&lt; endl; } </code></pre> <p><strong>main function</strong>:(as of 8:00 PM 12/11/2010)</p> <pre><code>#include "header.h" int main () { float currentPopulation, birthRate, deathRate, years; char response; do //main loop { input (currentPopulation, birthRate, deathRate, years); growthRate (birthRate, deathRate); estimatedPopulation (currentPopulation, years, birthRate, deathRate); output (currentPopulation, years, birthRate, deathRate); cout &lt;&lt; "\n Would you like another population estimation? (y,n) "; cin &gt;&gt; response; } while (response == 'Y' || response == 'y'); myLabel ("5-19", "12/09/2010"); system ("Pause"); return 0; } </code></pre> <p><strong>edit (8:00 PM 12/11/2010)</strong></p> <p>Solved! parameters, parameters, parameters! thanks for the input everyone.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload