Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone please help fix my code, I have no idea why this isnt accepting it Instructions Paula and Danny want to plant evergreen trees

can someone please help fix my code, I have no idea why this isnt accepting it image text in transcribed
image text in transcribed
image text in transcribed
Instructions Paula and Danny want to plant evergreen trees along the back side of their yard. They do not want to have an excessive number of trees. Write a program that prompts the user to input the following: 1. The length of the yard. 2. The radius of a fully grown tree. (Use 3.14159 as the constant value for any calculations that may need ). 3. The required space between fully grown trees. The program outputs: 1. The number of trees that can be planted in the yard 2. The total space that will be occupied by the fully grown trees. include ciostream> include Lomanip) sing namespace std; main() Il Get input from user double yard_length, tree_radius, required_space; cout e "Enter the length of the yard: "; cin yard_length; cout "Enter the radius of a fully grown tree: "; oin > tree.radius; cout e "Enter the required space between fully grown trees: ": cin required_space; If Calculate the space required for each tree double tree_diometer =2 + tree_radius; double tree_space = treo_dianeter + required_space; I/ Calculate the number of trees that can be planted and the total space they will occupy int num_trees = static_casteint)(Yard_length / tree_space); double total_space = num_trees + tree_diameter; II Output the results cout "Number of trees that can be planted: " num_trees e end1; cout "Total space occupied by the trees: " & flxed setprecision(2) total_spoce endl; return 9j Number and space for trees correctly output test 2 Input 88 11 29 Output Enter the length of the yard: 88 Enter the radius of a fully grown tree: 11 Enter the required space between fully grown Number of trees that can be planted: 1 Total space occupied by the trees: 22.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

Discuss the various types of policies ?

Answered: 1 week ago

Question

=+employee to take on the international assignment?

Answered: 1 week ago

Question

=+differences in home- and host-country costs of living?

Answered: 1 week ago