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
Which situation can result in positive population growth?
Solnce55 [7]
A massive ammount of crop growth.
7 0
3 years ago
How do you add text to a blank slide layout?
melisa1 [442]
<span>To add text anywhere on a slide (outside placeholders), click on the Insert menu --> Text Box, or on the text box icon on the drawing toolbar.Click and hold down the left mouse button while you drag the mouse. ...<span>Click inside the text box and start typing.</span></span>
8 0
3 years ago
Read 2 more answers
Convert the decimal number 164 into the equivalent 8 bit binary number. ​
umka2103 [35]

Answer:

10100100

Explanation:

8 bit system consists of 8 bits or 8 positions and each of them can have binary value (0 or 1).

Each bit is equivalent to a certain power of number 2. Important to know is that you read these bits from right to left.

So, this means that the bit furthest to the right has the value of 2^0, which is 1. The bit to the left has the value of 2^1, which is 2. Next one is 2^2, which is 4 etc. This means that the bit furthest to the left has the value of 2^7, which is 128.

The bit has this potential value only if value 1 if is in its position. If the value is 0 then, regardless of position, value of the bit is 0.

Decimal value of the number is calculated when we add all the values of the bits marked with 1.

So, we're dealing with number 164. We already said that leftmost bit has the value of 128 if it's marked with 1:

1 0 0 0 0 0 0 0 = 128

Next bit has the value of 64, but 128+64 would exceed the value of our number, so the second leftmost bit remains 0.

Next bit has the value of 32, 128+32 is 160, which is less then our number, so we mark the third bit with 1:

1 0 1 0 0 0 0 0 = 160

Similarly, we continue down the line. We only need 4 to reach the value of our number, so we'll mark with 1 the bit that has the value of 4, which leaves us with the solution:

1 0 1 0 0 1 0 0 = 164

7 0
3 years ago
Given variables first and last, each of which is associated with a str, representing a first and a last name, respectively. Writ
valentina_108 [34]

Answer:

The python code is attached

Explanation:

  1. I defined a function called Fullname
  2. The function accepts 2 parameters first and last
  3. last[0] gives the first letter of the last variable
  4. last[0].upper() modifies the first letter as upper letter
  5. same applied to variable first
  6. + sign concatenates strings and variables to the variable name
  7. the function returns the variable name

5 0
4 years ago
Technology trends in education play a key role in a student’s: social life. motivation. career readiness. job search.
skelet666 [1.2K]

Answer:

job search

Explanation:

job search bc you can look for jobs that are avalible online.

4 0
3 years ago
Read 2 more answers
Other questions:
  • What is the f(n) runtime of the following pseudocode: sum-0 for A = N/2 downto 1 for B-1 t increment sum by B Explain: exactly w
    13·1 answer
  • What types of information would be entered in a Microsoft Word table ?
    11·1 answer
  • It is always better to run over and give more information when you are giving a presentation versus quitting on time. true false
    15·2 answers
  • A message M is encapsulated by the TCP, IP and Ethernet protocols in that order as it travels down a protocol stack. What does t
    5·1 answer
  • In an URL what does the domain name describe?
    14·1 answer
  • Do you think lossy compression formats will be popular in 20 years? Why or why not?
    10·1 answer
  • How do you mark answers brainliest?<br> it looks like they changed it and now idk how to
    12·1 answer
  • You wrote a program to find the factorial of a number. In mathematics, the factorial operation is used for positive integers and
    14·2 answers
  • Which of the following are true about algorithms? (You may select more than one)
    12·1 answer
  • Which instruction is used to convert an integer value to float and push it onto the fpu stack?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!