Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The objective of this Program is to write a program to find the circumference, surface area and volume for a standard right circular cylinder given

image text in transcribed

The objective of this Program is to write a program to find the circumference, surface area and volume for a standard right circular cylinder given its radius and height, and to design a well formatted output for readability and precision. A right circular cylinder can be described by its height h and radius r. There are standard formulas for calculating areas and volumes C = 2 r Surface Area, SA Volume, V Write a C++computer program that will do the following: 1. 2. 3. Read in values of height and radius using cin Calculate the Circumference C, Surface Area SA, and Volume V using the standard formulas. For the given height calculate what the radius would need to be for a cylinder with the same height but a volume 50% greater. You will need to determine the proper formula to use for this. Print all the values (radius, height, circumference, surface area, volume, 50% greater volume and the radius associated with the 50% greater volume) You should echo the input values in addition to printing the calculated values. Use good formatting and labeling. Choose your own style; columns are suggested. Use comments. Print all values with 4 decimal places of precision Declare a constant for accurate to 6 or more decimal places. Please run the program with 3 sets of data for your submission: Cylinder 1: height of 1.0 Cylinder 2: height of 1010.0 radius of 250.0 Cylinder 3: height of 011radius of 0.55 radius of 1.0 The most efficient way to do multiple sets of input values is to use a loop, which we haven't learned yet. For this program submission, simply run the program 3 times, and paste a copy of each output window into your submission document. As an enhancement, consider adding an input parameter for the change in volume so that rather than always calculating exactly 50% greater, it is an input value (such as 25% or 50% or-25% ). Things to note: An alternate method to run 3 different sets of data without a loop would be to set up the code to run once, and process all three cases, one after the other. This is easy to do with copy/paste, but makes the program code nearly 3 times as long. If you are tempted to do this, think in terms of how you would do this if you had 20 or 100 different sets to process! For now it is preferred that you simply run the program 3 times, and not use copy/paste, or a loop yet. We will revisit this program when we've added loops to our repertoire, so be sure to save your code. A good way to test a program is to use nown values in order to verify if the program is working correctly! For example the first data set is a height of 1 and a radius of 1. This results are easy to calculate. Even though it isn't a required data set, you might try height of 1 and radius of 2 and verify those results. You should use known values whenever debugging your program, and you should always use the specified requested values when submitting a program. This is so that there is consistency in the output for grading purposes In grading your program I will be checking not only for the accuracy of your answers, but also that you have satisfied all the requested features and specifications outlined in the program information given above

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago