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
Tpy6a [65]
3 years ago
12

Write a complete program that asks the user to input the height and radius of a cone (both of type double) and calls two individ

ual functions to calculate the total area of the cone and the volume of the cone. The main function then prints these values with appropriate messages.
Computers and Technology
1 answer:
Vika [28.1K]3 years ago
4 0

Answer:

The program in C++ is as follows:

#include <iostream>

#include <math.h>

using namespace std;

double area(double r, double h){

   double A = 3.14 * r * (r + sqrt(h*h + r*r));

   return A;}

double volume(double r, double h){

   double V = (1.0/3) * 3.14 * r*r * h;

   return V;}

int main(){

   double radius, height;

   cout<<"Radius: "; cin>>radius;

   cout<<"Height: "; cin>>height;

   cout<<"Area: "<<area(radius,height)<<endl;

   cout<<"Volume: "<<volume(radius,height);

   return 0;

}

Explanation:

This declares the area function

double area(double r, double h){

Calculate area

   double A = 3.14 * r * (r + sqrt(h*h + r*r));

Return the calculated area

   return A;}

This declares the volume method

double volume(double r, double h){

Calculate volume

   double V = (1.0/3) * 3.14 * r*r * h;

Return the calculated volume

   return V;}

The main begins here

int main(){

Declare radius and height

   double radius, height;

Get input for radius

   cout<<"Radius: "; cin>>radius;

Get input for height

   cout<<"Height: "; cin>>height;

Call the area function and print the returned value for area

   cout<<"Area: "<<area(radius,height)<<endl;

Call the volume function and print the returned value for volume

   cout<<"Volume: "<<volume(radius,height);

   return 0;

}

You might be interested in
Where's the space key again <br> Sorry I forgot <br> I'm so inbarest sorry <br> In my computer
Kipish [7]
The space key is the longest key on the bottom of the keyboard

8 0
4 years ago
Which data type could be used for the field, remark or comment? ​
katrin2010 [14]

Answer:

While CLOB/NCLOB types may seem attractive, they are not nearly as efficent as [N]VARCHAR for most of the functions you would usually want to run on them, and anyone who can't comment in 2000 or 4000 characters isn't likey to generate a comment you'd want to use anyway.

copied from google

hope that helps

3 0
3 years ago
When should students practice netiquette in an online course? Check all that apply.
mixas84 [53]

Answer:

when sending emails to classmates

when participating in online discussion boards

when collaborating as part of digital team

Explanation:

i just took the test

5 0
3 years ago
How do ice and water on the ground affect incoming solar radiation? They filter 22 percent of solar radiation that reaches the s
olganol [36]

Answer: 4 percent

Explanation:

8 0
3 years ago
Read 2 more answers
Alguien me puede ayudar a arreglar mis auriculares que mi perro rompió en el conector
Strike441 [17]
Que rompio el perro? Todo depiende de la situacion. 
7 0
4 years ago
Other questions:
  • The process of converting information, such as text, numbers, photos, or music, into digital data that can be manipulated by ele
    7·1 answer
  • Can you help me correct a sentence?
    13·1 answer
  • Write down the complete procedure for creating ExcelSheet.
    8·1 answer
  • What component of a computer system holds the operating system when the computer is not running
    6·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    12·1 answer
  • Which of the following ways is NOT one of the ways that the census is
    5·1 answer
  • Assume a TCP segment consisting of 1500 bits of data and 160 bits of header is sent to the IP layer, which appends 120 bits of h
    14·1 answer
  • (Bible)<br> Sin may be an inward thought or an outward act. True False
    11·2 answers
  • Select the correct answer from each drop-down menu.
    8·2 answers
  • What is one of the fastest ways to search for an items on a specfic web site
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!