Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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.
Logic errors.
#include
#include
using namespace std;
int main
double cost;
double area;
double bagSize;
cout fixed showpoint setprecision;
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 ;
Format your output with setprecision to ensure the proper number of decimals for testing!
Task #: Cost per pound and per square foot correctly output
Test Feedback:
Status: FAILED!
Check:
Test: Cost per pound and per square foot correctly output test
Reason: Unable to find in the program's output.
Enter the amount of fertilizer, in pounds, in one bag:
Enter the cost of the pound fertilizer bag:
Enter the area, in square feet, that can be fertilized by one bag:
The cost of the fertilizer per pound is: $
The cost of fertilizing per square foot is: $
Error : AssertionError Unable to find a number close enough to in the program's output.
Timestamp: ::
Status: FAILED!
Check:
Test: Cost per pound and per square foot correctly output test
Reason: Unable to find in the program's output.
Enter the amount of fertilizer, in pounds, in one bag:
Enter the cost of the pound fertilizer bag:
Enter the area, in square feet, that can be fertilized by one bag:
The cost of the fertilizer per pound is: $
The cost of fertilizing per square foot is: $
Error : AssertionError Unable to find aThe 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started