1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
cricket20 [7]
3 years ago
13

Write the following functions. Each function needs function comments that describes function and its parameters double sphereVol

ume( double radius) double sphereSuface( double radius) double cylinderVolume( double radius, double height) double coneSurface( double radius, double height) double coneVolume( double radius, double height) That computes the volume and surface of the sphere with radius, a cylinder with a circular base with radius radius , and height height , and a cone with a circular base with radius radius , and height height . Then write a test program to prompt user to enter values of radius and height, call six functions and display the results c++
Computers and Technology
1 answer:
luda_lava [24]3 years ago
4 0

Answer:

Output

height: 10

radius: 2

Cylinder volume: 125.6

Cone Surface: 76.6037

Cone Volume: 41.8667

Sphere volume: 33.4933

Sphere surface: 50.24

Cylinder volume: 125.6

Explanation:

//Declaring variables

#include <iostream>

#include <cmath>

using namespace std;

//Defining Pi value

const double PI=3.14;

//Decliring the functions

//volume function for cone

double volumeCone(double r,double h){

       return  PI * r * r  * (h/3);

}

//volume function for sphere surface

double surfaceSphere(double r){

       return 4 * PI  * r * r;

}

//volume function for cylinderVol

double cylinderVol(double r,double h){

       return  PI * r * r * h;

}

//volume function for sphere volume

double sphereVol(double r){

       return 4/3.0 * PI * r * r * r;

}

//volume function for cone surface

double surfaceCone(double r,double h){

       return  PI * r * (r+sqrt(h *h + r  * r));

}

int main(){

       double r,h;

//print the values of height and radius

       cout<<"height: ";

       cin>>h;

       cout<<"radius: ";

       cin>>r;

//print the values of geometric forms

       cout<<"Cylinder volume: "<<cylinderVol(r,h)<<endl;

       cout<<"Cone Surface: "<<surfaceCone(r,h)<<endl;

       cout<<"Cone Volume: "<<volumeCone(r,h)<<endl;

       cout<<"Sphere volume: "<<sphereVol(r)<<endl;

       cout<<"Sphere surface: "<<surfaceSphere(r)<<endl;

       cout<<"Cylinder volume: "<<cylinderVol(r,h)<<endl;

       

       

}

You might be interested in
What is virtual memory? What is the function of associative memory?
zheka24 [161]

Answer:

Virtual memory is a feature of an operating system that enables a computer to be able to compensate shortages of physical memory by transferring pages of data from random access memory to disk storage. ... This means that when RAM runs low, virtual memory can move data from it to a space called a paging file.

Associative memory is also known as content addressable memory (CAM) or associative storage or associative array. It is a special type of memory that is optimized for performing searches through data, as opposed to providing a simple direct access to the data based on the address.

3 0
3 years ago
When you get ###### or 1.1E+13 as a result in a cell, it means:
Zigmanuir [339]
This simply means that the cell is not wide enough to be able to show all the contents entered into that cell
7 0
3 years ago
A major ozone depletion happened in the 1900s. What was it caused by
melomori [17]
It was caused by air pollution and the extreme heat built up underneath it. <span />
3 0
4 years ago
Read 2 more answers
What is the software that finds websites, webpages, images, and other information called?search applicationsubject directorysubj
san4es73 [151]
It is called a search application
7 0
4 years ago
Read 2 more answers
Es el nombre que se le da a la<br> intersección de una columna y fila:
BARSIC [14]

Answer:

en ingles es cell

Explanation:

3 0
3 years ago
Other questions:
  • a password to a certain database consists of digits that cannot be repeated. if the password is known to consist of at least 8 d
    14·1 answer
  • Ted knows that macros can be helpful to him in his work with Excel spreadsheets,but he also knows they have their hazards,so he
    15·1 answer
  • The local area network software called a ____ server provides workstations with the authorization to access a particular printer
    13·1 answer
  • In this lab, you will build a system for package delivery services that provides different shipping options with specific price.
    6·1 answer
  • Which task should happen during the planning stage of a project? reflect on the project outcomes prevent set-backs determine the
    11·1 answer
  • What would be the desired output of the home-security system
    8·1 answer
  • One security component that doubles as a network component
    5·2 answers
  • A computer is the __________ of an attack when it is used to conduct an attack against another computer.
    11·1 answer
  • The electors in each state shall have the qualifications requisite for electors of the most numerous branch of the state legisla
    11·1 answer
  • Which option best describes top-down design?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!