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.:- M92798156
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question suppose that a simple fpga programmable switch

Question : Suppose that a simple FPGA programmable switch that has four destination points (N, S, E and W) and consists of 6 pass transistors with 6-SRAM cells to program each gate (T1, T2, T3, T4, T5, T6) is used. If th ...

Subject computer algorithmsbook introduction to algorithms

Subject : Computer Algorithms Book: Introduction to Algorithms 3rd edition 1) a) Using Figure 10.1 as a model, illustrate the result of each operation in the sequence PUSH(S,6), PUSH(S,2), PUSH(S,8), POP(S), PUSH(S,5), P ...

Recall that a floating-point number can be expressed as-1s

Recall that a floating-point number can be expressed as (-1) s (1 + f) 2 e where s, f and e are binary numbers. Recall that s is the sign indicator, f the mantissa (or fractional part), and e the exponent. Suppose the si ...

Question discuss the advantages and disadvantages of

Question: Discuss the advantages and disadvantages of Incident Response testing. When is each type of testing appropriate? Are there situations that preclude the use of a particular type of testing? Requirement: I recomm ...

A survey of 200 students is selected randomly on a large

A survey of 200 students is selected randomly on a large university campus. They are asked if they use a laptop in class to take notes. The results of the survey is that 70 of the 200 students responded yes. Calculate th ...

Question suppose a process ie parent forks a child process

Question : Suppose a process (i.e., parent) forks a child process using resource sharing such that the parent and child share all resources. Does this include the Process Control Block and memory space or does the child ...

Start from scratch on each of the parts write a main

Start from scratch on each of the parts. Write a main function that declares an array of 100 doubles. In a for loop, assign each of the doubles a random number between 0.50 and 50.00. Here's how. array[i] = (double) (ran ...

Question each student will research a paper on big data

Question: Each student will research a paper on Big Data word document 1000 to 1500 words with graphics describing the following: 1. what is Big Data? 2. Origins ? 3. Differences? 4. examples of Big data your point of vi ...

Two countries australia and france have their interest

Two Countries Australia and France have their interest rates to be 8% and 2 %, respectively. If their currencies trade according to 2 Australian $s buy one euro in the spot market, what will their future spot rate be in ...

Question suppose you have already written the class for a

Question : Suppose you have already written the class for a Bowler. The Bowler class has two fields, a full name and a high score. Write the main() method to create two instances of this Bowler class. Get the input from ...

  • 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