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
The hardware to keep the output data when finished is a
Bess [88]
I believe the answer is modem
4 0
3 years ago
You have taken a new job as a network administrator. Although you have been an IT professional within your organization for a nu
sdas [7]

Answer:

Except more than one token can exist on a token ring network

Explanation:

The token ring is the LAN(Local Area Network) in which the computer systems are connected with each other computers in the form of topologies. In the token ring networks more than one logic tokens from one host to another host.

The token ring has entirely taken over by the Ethernet because it is cheaper and better in price and performance.

3 0
4 years ago
Jin needs to add a row into his spreadsheet, but he does not want to remove any existing data. Which combination of options shou
disa [49]

Answer:

b. insert > entire row

5 0
3 years ago
Read 2 more answers
A standard computer monitor is 1024 pixels wide and 768 pixels tall
Annette [7]
If this is a true or false question the answer is true
8 0
4 years ago
_______ is defined as a state of periodic or chronic impairment detrimental to the individual and society.
aleksandrvk [35]
I believe the answer is addiction. 
8 0
3 years ago
Read 2 more answers
Other questions:
  • The opening of the throttle plate can be delayed as long as
    13·1 answer
  • Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alre
    8·2 answers
  • Without a well-designed, accurate database, executives, managers, and others do not have access to the ____________________ they
    15·1 answer
  • What do you think the need for so many different form factors and server types are?
    13·1 answer
  • When was kale discovered?
    9·1 answer
  • I am writing a Python code to ask a user to enter students' information including name,
    10·1 answer
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRIST AND CORRECT
    10·2 answers
  • Which of the following is NOT present on the Title Bar?​
    7·1 answer
  • Rudy accidentally sent a sensitive work report to a personal friend named James instead one of his co-workers, who is also named
    6·1 answer
  • 2023 murano’s available intelligent awd adjusts the ________ to help maintain cornering control.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!