Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Make a class named Cylinder with a field for the radius and a field for the height. Be sure to include the following:

  • a default constructor that sets the radius to 3 and height to 8
  • a setter function to set the value of the radius
  • a setter function to set the value of the height
  • a getter function to return the value of the radius
  • a getter function to return the value of the height
  • a function to compute and return the cylinder's surface area

Be aware that the surface area of a cylinder is 2 * pi * radius * radius + 2 * pi * radius * height. Feel free to use the value of 3.14 for pi.

Next, provide an appropriate main function (driver code) to test this class. Create an object with a radius of 10. Make a second Cylinder object that uses the radius set by the default constructor. Once the objects have been created, add code to change the values of the first Cylinder object and display the surface area of both cylinders in an attractive fashion.

Sample Session:

Please enter the radius: 5

Please enter the height: 8

The cylinder with a radius of 3 and height of 8 has a surface area of:  207.24

The cylinder with a radius of 5 and height of 8 has a surface area of:  408.20

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92792839
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

A scavenger hunt question from the assigned

A scavenger hunt question from the assigned readings.) Consider the statement if ((a! = null)&&(a.x()))a.y(); What feature of the a && b makes it classify as a control structure? Rewrite this as 2 nested if statements. W ...

A banks assets equal its liabilities under a both

A bank's assets equal its liabilities under a. both 100-percent-reserve banking and fractional-reserve banking. b. 100-percent-reserve banking but not under fractional-reserve banking. c. fractional-reserve banking but n ...

Question it has been stated that the increase in adoption

Question : It has been stated that the increase in adoption of cloud computing is similar to the story of why companies moved to adopted the public electrical grid. What motivated companies to adopt the public electrical ...

Without doing any math or drawing a graph which is bigger

Without doing any math, or drawing a graph, which is bigger, compensating variation or equivalent variation for a tax? Consider an individual with Cobb-Douglas preferences over some good and all other goods. In what sens ...

Lets do some r suppose you have the following situation you

Let's do some R.... Suppose you have the following situation: You have a large jar of beans, 43% black, 57% white. You take a sample of 14 beans. a) Use R to figure out the probability for every single possible outcome. ...

Riditna paper withdraws river water for use in its paper

Riditna Paper withdraws river water for use in its paper mill, and returns it, along with waste effluent, back into the river. (Effluent is a co-product of Riditna's paper, such that production of each ream of paper gene ...

Stack implemented with slldesign and code your own lifo

Stack implemented with SLL Design and code your own LIFO Stack using single liked list to hold a list of integers. Use the C++ "struct" structure to create your SLL nodes. Node position numbering should start with one. Y ...

Question suppose the array begins with 0 followed by the

Question : Suppose the array begins with 0, followed by the remaining even integers in descending order, followed by the odd numbers in descending order. (For n = 8, the array would be [0,8,6,4,2,7,5,3,1].) How many comp ...

Compare remote authentication dial-in user service radius

Compare Remote Authentication Dial-In User Service (RADIUS) and Terminal Access Controller Access-Control System Plus (TACACS+).

Question introduction to management information systemsread

Question: Introduction to Management Information Systems Read at least three (3) academically reviewed articles on Management Information Systems and complete the following activities: 1. Summarize all three (3) articles ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As