Note that there are some explanatory texts on larger screens.

plurals
  1. POMy equations in putty, completely stumped
    primarykey
    data
    text
    <p>I cannot for the life of me figure out what is wrong with these simple equations I have in putty. I think everything is set up right, but my output is wrong from my professors sample output by a slight degree.</p> <pre><code>//This program is used to calculate total cost of painting. #include &lt;iostream&gt; #include &lt;iomanip&gt; using namespace std; //These are the function prototypes that will be used for the main function. void displayInstructions(int &amp;feet, float &amp;price); float paintprice (int feet, float price); float laborprice (int feet); float totalcost(float paint, float labor); void displayoutput (float paint, float labor, float total, int feet); int main() { int feet=0; float price=0; float paint=0; float labor=0; float total=0; displayInstructions(feet, paint); paint=paintprice(feet, paint); labor=laborprice(feet); total=totalcost(labor, paint); displayoutput(paint, labor, total, feet); return 0; } void displayInstructions(int &amp;feet, float &amp;price) { cout&lt;&lt;setw(35)&lt;&lt;"==================================="&lt;&lt;endl; cout&lt;&lt;setw(30)&lt;&lt;"Painting Cost Calculator" &lt;&lt;endl; cout&lt;&lt;setw(35)&lt;&lt;"===================================" &lt;&lt;endl; cout&lt;&lt;"This program will compute the costs (paint, labor, total)\nbased on th\ e square feet of wall space to be painted \ and \nthe price of paint." &lt;&lt;endl; cout&lt;&lt;"How much wall space, in square feet, is going to be painted?" &lt;&lt;endl; cin&gt;&gt;feet; cout&lt;&lt;"How much is the price of a gallon of paint?" &lt;&lt;endl; cin&gt;&gt;price; } float paintprice (int feet, float price) { float paint; paint=((feet/115)*price); return paint; } float laborprice (int feet) { float labor; labor=((feet/115)*18*8); return labor; } float totalcost (float paint, float labor) { float total; total=(paint+labor); return total; } void displayoutput (float paint, float labor, float total, int feet) { cout&lt;&lt;"Square feet:" &lt;&lt;feet &lt;&lt;endl; cout&lt;&lt;"Paint cost:" &lt;&lt;paint &lt;&lt;endl; cout&lt;&lt;"Labor cost:" &lt;&lt;labor &lt;&lt;endl; cout&lt;&lt;"Total cost:" &lt;&lt;total &lt;&lt;endl; } </code></pre> <p>based on the input being feet=12900, and price=12.00 The final output for the cost of paint should be $1346.09 The final output for the cost of labor should be $16153.04</p> <p>I get respectively: $1344.00, $16128.00</p> <p>if you can help me out it would be a life saver.</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.
 

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