Write two short programs in C++. The first one will use procedural programming a
ID: 3889546 • Letter: W
Question
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. Submissions: Submit an electronic copy via the D2L dropbox. Formulas: • Volume of a right circular cylinder: • Total surface area:
Explanation / Answer
NOTE: Below is the required code for your assignment. Please check and let me know if you have any questions. I will revert back within 24 hours.
procedural:
code: http://pasted.co/43ca0ffb
code output: https://pasteboard.co/GJ2tiZJ.jpg
oop:
code: http://pasted.co/5a476b59
code output: https://pasteboard.co/GJ2xSrn.jpg
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.