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
Select all the mistakes in the following: There may be more than one.
sdas [7]

The if statement should have two equal signs, the elseif should be elif, and the else statement should have a colon at the end of it.  There might be more errors in the indentation but I cant know unless I see a picture of the problem. The print statement should be indented into the if, elif, and else statements.

4 0
3 years ago
An organism which must obtain its food from other organism is called a ​
Sophie [7]

Answer:

Heterotrophs

Explanation:

Heterotrophs, or consumers, are organisms that must obtain energy by consuming other organisms (autotrophs or other heterotrophs) as food.

5 0
4 years ago
Read 2 more answers
The tuning systems were not always reliable during the Baroque period. Why did composers use key signatures?
lapo4ka [179]

Key signatures were used because simply by knowing how many sharps or flats there were, the tuning would be more uniform. Tuning systems were not developed yet during the Baroque era and the concept of key was not introduced by then.

<span> </span>

7 0
4 years ago
What position should you hand be on the steering wheel? yuyuyhj
Diano4ka-milaya [45]

Answer:

9 and 3

Explanation:

its the right way and njcs wdhiqgua wdiu posef

8 0
3 years ago
Privilege escalation is an​
olga55 [171]

Answer:

Privilege escalation is the act of exploiting a bug, design flaw or configuration oversight in an operating system or software application to gain elevated access to resources that are normally protected from an application or user.

Explanation:

give brainiest plzlz

7 0
3 years ago
Other questions:
  • Mile markers appear as _____ green signs.
    6·2 answers
  • A broadband router is used to do which of the following? run the programs on a computer locate lost files on a computer manage a
    6·1 answer
  • What product category does the brand fit into?
    7·1 answer
  • Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. If the actor is not i
    11·1 answer
  • Let's practice Audience analysis by going to the Google Merchandise Store demo account with a date range of Feb 1, 2016 - Feb 29
    13·1 answer
  • ____ is one of the primary operations of a computer.
    10·1 answer
  • in an advertisement is made of a wireless keyboard and a mouse.Name two commonly used methods of connecting devices wirelessly​
    11·1 answer
  • Who is responsible for the actions of autonomous systems? (please help me :C)
    14·2 answers
  • How to add a legend to a graph in excel?
    7·2 answers
  • Artificial intelligence (ai) in perspective is a complex and interdisciplinary field that involves several specialties, includin
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!