Question
// Tom and Jerry opened a new lawn service. They provide three types of services: mowing, fertilizing, and planting trees. The cost of mowing is
// Tom and Jerry opened a new lawn service. They provide three types of services: mowing, fertilizing, and planting trees. The cost of mowing is $35.00 per 5000 square yards (or fraction thereof), fertilizing is $30.00 per application, and planting a tree is $50.00. Write an algorithm that prompts the user to enter the area of the lawn, the number of fertilizing applications, and the number of trees to be planted. The algorithm then determines the billing amount.
#include
using namespace std;
int main()
{
// Mowing cost = $35 per 5000 sq yards //
int area_square_yards = ;
cout << Please enter are of the lawn in square yards.;
cin >> area_square_yards;
// Fertilizing cost = $30 per app //
int number_of_fert_appl = ;
cout << Please enter number of fertilizing applications.;
cin >> number_of_fert_appl;
// Planting a tree cost = $50 //
int number_of_trees = ;
cout << Please Enter number of trees to be planted.;
cin >> number_of_trees;
// Figuring out the cost based on the information given //
int cost = (area_square_yards)*(35.0/5000.0) + (number_of_fert_appl*30.0) + (number_of_trees*50.0);
cout << The Total Bill Amount is equal to
<< cost<<.;
return 0;
}
not quite sure where I've made a mistake but I can't seem to get this to work 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