Question: CIS 1275 C++ Programming Part I Program 1 You are the manager of the C++ Greenhouse. It is time to order the potting soil for

CIS 1275 C++ Programming Part I

Program 1

You are the manager of the C++ Greenhouse. It is time to order the potting soil for next season. You have many different sizes of pots, and will write a program to calculate the volume of soil and drainage pebbles (gravel) needed for any size, and of course, how much the soil and pebbles will cost.

The prices are: Vigoro Organic Potting mix is $7.97 per cubic foot

Vigoro pea pebbles for bottom of the pot is $3.98 per cubic foot

How to calculate the pot volume, the soil volume and the gravel volume: Assumptions and estimates: Pots are truncated cylinders. The diameter of the pot is roughly equal to the height of the pot. We will estimate the volume of the pot as if it were a right circular cylinder with an average diameter equal to the diameter at the half-height of the pot. We will say that the average diameter at the half-height = (top diameter + bottom diameter) /2. The bottom diameter of the pot is 2 inches less than the top diameter. The volume of a right circular cylinder is (PI * height * radius * radius). We will estimate that soil and gravel fill the pot up 80% (the top 20% is empty). A 1 inch layer of gravel will be placed at the bottom of the pot.

In main, declare variables and declare PI and the prices for soil and gravel as constants. cout your header to write the information discussed above.

Ask the user for the top diameter of the pot. Then ask the user for the number of pots to be calculated. Then calculate the average diameter of the pot and the average radius. Calculate the volume of the pot, the volume of the soil and gravel in the pot, then the volume of the gravel and the volume of the soil. These volumes are in cubic inches. Convert the volume to cubic feet and calculate the price of the soil, the price of the gravel and the total price to be paid.

Report the results to the user, showing the pot size, the volume of soil required, and the price. Then report the volume of gravel, and the price. Finally, report the total cost for filling the pot.

Write your results to 2 decimal places of precision and use dollar signs for the monetary amounts.

Write a good-bye message to the customer before exiting.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!