During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag...


During each summer, John and Jessica grow<br>vegetables in their backyard and buy seeds and<br>fertilizer from a local nursery. The nursery carries<br>different types of vegetable fertilizers in various bag<br>sizes. When buying a particular fertilizer, they want<br>to know the price of the fertilizer per pound and the<br>cost of fertilizing per square foot. The following<br>program prompts the user to enter the size of the<br>fertilizer bag, in pounds, the cost of the bag, and the<br>area, in square feet, that can be covered by the bag.<br>The program<br>should output the desired result. However, the<br>program contains logic errors. Find and correct the<br>logic errors so that the program works properly.<br>I/Logic errors.<br>#include <iostream><br>#include <iomanip><br>using namespace std;<br>int main()<br>{<br>double cost;<br>double area;<br>double bagSize;<br>cout << fixed<< showpoint << setprecision(2);<br>cout << > bagSize; cout < endl;="" cout="">< "enter="" the="" cost="" of="" the="">< bagsize="">< "="" pound="" fertilizer="" bag:="" ";="" cin="">> cost; cout < endl;="" cout="">< "enter="" the="" area,="" in="" square="" feet,="" that="" can="" be="" "="">< "fertilized="" by="" one="" bag:="" ";="" cin="">> area; cout < endl;="" cout="">< "the="" cost="" of="" the="" fertilizer="" per="" pound="" is:="" $"="">< bagsize="" cost="">< endl;="" cout="">< "the="" cost="" of="" fertilizing="" per="" square="" foot="" is:="" $"="">< area="" cost="">< endl;="" return="" 0;="" "/="">
Extracted text: During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. I/Logic errors. #include #include using namespace std; int main() { double cost; double area; double bagSize; cout <>< showpoint="">< setprecision(2);="" cout="">< "enter="" the="" amount="" of="" fertilizer,="" in="" pounds,="" "="">< "in="" one="" bag:="" ";="" cin="">> bagSize; cout < endl;="" cout="">< "enter="" the="" cost="" of="" the="">< bagsize="">< "="" pound="" fertilizer="" bag:="" ";="" cin="">> cost; cout < endl;="" cout="">< "enter="" the="" area,="" in="" square="" feet,="" that="" can="" be="" "="">< "fertilized="" by="" one="" bag:="" ";="" cin="">> area; cout < endl;="" cout="">< "the="" cost="" of="" the="" fertilizer="" per="" pound="" is:="" $"="">< bagsize="" cost="">< endl;="" cout="">< "the="" cost="" of="" fertilizing="" per="" square="" foot="" is:="" $"="">< area="" cost="">< endl;="" return="">

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here