Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task: Write two short programs in C++ . The first one will use procedural programming and the second one will use object-oriented programming (classes). Both

Task: Write two short programs in C++. The first one will use procedural programming and the second one will use object-oriented programming (classes). Both programs will accept the radius and height of a right circular cylinder from the user and will calculate the volume and total surface area of the cylinder. Program A: Use at least one function with the procedural program.

Program B: Declare a cylinder class, and then define an object that is an instance of that class. Create appropriate accessor and mutator functions for the class. Both programs: Input at least 3 sets of radius/height data (within a loop), and for each set of data, display the radius, height, volume and surface area of the cylinder. The user may choose the input data. Output: Both programs may display the results to the monitor.

Formulas: Use the formula for Volume of a right circular cylinder and Total surface area:

If your program does not compile and run, it will not be graded!! Make sure your programs are well documented both internally and externally.

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

Students also viewed these Databases questions