Create a class called geometrycalculator.

Assignment Help C/C++ Programming
Reference no: EM13939853

Write static methods

- public static double sphereVolume(double r)
- public static double sphereSurface(double r)
- public static double cylinderVolume(double r, double h)
- public static double cylinderSurface(double r, double h)
- public static double coneVolume(double r, double h)
- public static double coneSurface(double r, double h)

that compute the volume and surface area of a sphere with radius r, a cylinder with circular base with radius r and height h, and a cone with circular base with radius r and height h. Place them into a class Geometry. Then write a program that prompts the user for the values of r and h, calls the six methods, and prints the results.

Here is a sample program run:
Please enter the radius: 5
Please enter the height: 10
The volume of the sphere is: 523.5987755982989
The surface area of the sphere is: 314.1592653589793
The volume of the cylinder is: 785.3981633974483
The surface area of the cylinder is: 471.23889803846896
The volume of the cone is: 261.79938779914943
The surface area of the cone is: 254.160184615763

Your main class should be called GeometryCalculator.

You need to supply the following class in your solution: Geometry

Reference no: EM13939853

Questions Cloud

Mainstream ir theories of realism and liberalism : Mainstream IR theories of realism, liberalism and constructivism. Which one do you think has the LEAST explanatory power and why
Discuss how the internet is changing the way : Question: The internet is a part of our daily lives. Discuss how the internet is changing the way we think today and in the future. -Please remember that you will need to have at least Four (4) varying references. For example: Journals, WebPages, ..
What is amount of initial cash flow for expansion project : High Breeze currently produces boat sails and is considering expanding into awnings for homes and travel trailers. The company owns land that could be used for the expansion. This land was purchased five at a cost of $319,000 and is valued today at $..
Compute tax payable and wages that will be paid to employee : Compute the taxes payable and wages that will be paid to employees. Then prepare the journal entries to record the wages earned and the payroll taxes.
Create a class called geometrycalculator. : compute the volume and surface area of a sphere with radius r, a cylinder with circular base with radius r and height h, and a cone with circular base with radius r and height h.
Experience working in a technical analyst role : Demonstrated experience working in a Technical Analyst role; Ability to perform under pressure and to tight deadlines; Demonstrated experience working within a Security conscious environment; Demonstrated experience working in a Defence environmen..
Evaluating my own experience performance asclinical educator : Evaluating my own experience performance as a clinical educator by reflecting on the experience and referring to current relevant educational literature.
Projects that may be adjusted if a recession is on horizon : Pick any industry that you would like to know more about (automobile industry). What are some examples of short term versus long term projects that may be adjusted if a recession is on the horizon? Write in detail with descriptive examples.
Dividends are expected to grow at rate : Synovec Co. is growing quickly. Dividends are expected to grow at a rate of 25 percent for the next three years, with the growth rate falling off to a constant 4 percent thereafter. If the required return is 10 percent, and the company just paid a di..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program that computes customers

Design the main so that it have a menu that allows theuser to add items to the customer order, and check the customer out by showing the total charges.

  Problem related to stroing of text file values into vector

I have to store the text file values into a vector and do the sum, here the text file sample: Expenses: Equipment:$300 Food: $50  Consumable expenses: $100

  Design an employee class that has fields for name

Design an Employee class that has fields for the following pieces of information: Employee Name and Employee Number

  Show veclist after the following statement executes

Suppose that vecList is a vector container and vecList = {12, 16, 8, 23, 40, 6, 18, 9, 75} Show vecList after the following statement executes:

  Write a program that estimates the temperature in a freezer

Write a program that estimates the temperature in a freezer (in degrees C) given the elapsed time (hours) since a power failure. Assume this temperature (T) is given by

  Create a template class

Create a template class, SVector, that implements a constructor

  Refined into a generalization/ specialization hierarchy

Which classes might be refined into a generalization/ specialization hierarchy? List the superclass and any subclasses for each of them.

  Create your own programmer-defined class

How is the syntax for a class in C++ similar to the syntax for structures in C? Use this syntax to create your own programmer-defined class

  Write a program that first prompts the user

Write a program that first prompts the user (repeatedly , if necessary) to supply a single digit(0,1,2..9) The program should repeatedly prompt the user for integer values until a sentinel value of 0 is entered to terminate the program.

  Compare the following strategies with programming time

For a certain program, 1% of the code accounts for 50% of the execution time. Compare the following strategies with respect to programming time and execution time. Assume that it would take 100 man-months to write it in C, and that assembly code i..

  Write one input function to input one number

Write one input function to input one number, returning that value via the return statement to the calling function. You will need to call this function 4 times to get all 4 values

  Write a program that uses the class salariedemployee

Write a program that uses the class SalariedEmployee shown below. Your program is to define a class called Administrator, which is to be derived from the class SalariedEmployee. You are allowed to change private in the base class to protected. You..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd