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
Fofino [41]
2 years ago
8

Given parameters b and h which stand for the base and the height of an isosceles triangle (i.e., a triangle that has two equal s

ides), write a C program that calculates: The area of the triangle; The perimeter of the triangle; And The volume of the cone formed by spinning the triangle around the line h The program must prompt the user to enter b and h (both of type double) The program must define and use the following three functions: Calc Area (base, height) //calculates and returns the area of the triangle Calc Perimeter (base, height) //calculates and returns the perimeter Calc Volume(base, height) //calculates and returns the volume
Computers and Technology
1 answer:
schepotkina [342]2 years ago
3 0

Answer:

The area of the triangle is calculated as thus:

Area = 0.5 * b * h

To calculate the perimeter of the triangle, the measurement of the slant height has to be derived;

Let s represent the slant height;

Dividing the triangle into 2 gives a right angled triangle;

The slant height, s is calculated using Pythagoras theorem as thus

s = \sqrt{b^2 + h^2}

The perimeter of the triangle is then calculated as thus;

Perimeter = s + s + b

Perimeter = \sqrt{b^2 + h^2} + \sqrt{b^2 + h^2} +b

Perimeter = 2\sqrt{b^2 + h^2} + b

For the volume of the cone,

when the triangle is spin, the base of the triangle forms the diameter of the cone;

Volume = \frac{1}{3} \pi * r^2 * h

Where r = \frac{1}{2} * diameter

So, r = \frac{1}{2}b

So, Volume = \frac{1}{3} \pi * (\frac{b}{2})^2 * h

Base on the above illustrations, the program is as follows;

#include<iostream>

#include<cmath>

using namespace std;

void CalcArea(double b, double h)

{

//Calculate Area

double Area = 0.5 * b * h;

//Print Area

cout<<"Area = "<<Area<<endl;

}

void CalcPerimeter(double b, double h)

{

//Calculate Perimeter

double Perimeter = 2 * sqrt(pow(h,2)+pow((0.5 * b),2)) + b;

//Print Perimeter

cout<<"Perimeter = "<<Perimeter<<endl;

}

void CalcVolume(double b, double h)

{

//Calculate Volume

double Volume = (1.0/3.0) * (22.0/7.0) * pow((0.5 * b),2) * h;

//Print Volume

cout<<"Volume = "<<Volume<<endl;

}

int main()

{

double b, h;

//Prompt User for input

cout<<"Base: ";

cin>>b;

cout<<"Height: ";

cin>>h;

//Call CalcVolume function

CalcVolume(b,h);

//Call CalcArea function

CalcArea(b,h);

//Call CalcPerimeter function

CalcPerimeter(b,h);

 

return 0;

}

You might be interested in
IF U LOVE CODING CLICK HERE!!! : )
erik [133]

Answer:

I think it is the last one. Or first. Try first though.

Explanation:

Have a Great Day.

8 0
2 years ago
George enters the types of gases and the amount of gases emitted in two columns of an Excel sheet. Based on this data he creates
Alex777 [14]

Answer:

data source

Explanation:

The main aim of a data source is for the gathering of all necessary information that is needed to access a data. Since he has used the information to create a pie chart, this means that some data were used for the creation of this pie chart. Hence the information used for the creation of the pie chart is the data source for the information illustrated on the pie chart.

3 0
3 years ago
Jack was drinking a glass of water near his computer when his dog bumped his arm, spilling water on his keyboard. What is the fi
Anvisha [2.4K]

Answer:

4no. is the answer may be

3 0
2 years ago
Read 2 more answers
PLEASE HELP what is the mechanical advantage of a wheel with a radius of 8.0 cm connected with a axle with a radius of 2.5 cm?
Paraphin [41]
3.2 i believe. I looked it up though
5 0
3 years ago
Read 2 more answers
Help me guys pleassssssssse​
Readme [11.4K]

Answer:

is there a word bank??

Explanation:

8 0
2 years ago
Other questions:
  • How is sharepoint used in organization today?
    12·1 answer
  • I need the code for Assignment 5 Animation in Edhesive, its in python code.
    9·1 answer
  • How do I get more points?
    13·2 answers
  • You use an escape sequence to include ___________________ in a string.
    15·1 answer
  • Wired network are the most reliable and provide the highest speed?
    7·1 answer
  • When you use information hiding by selecting which properties and methods of a class to make public, you are assured that your d
    14·1 answer
  • Which programming element is used by a game program to track and display score information
    12·2 answers
  • You are planning a program to find the maximum heart rate recommended for patrons of a gym where you have a part-time job. One f
    13·1 answer
  • Which subunit of a heterodimeric cdk is the regulatory subunit?
    6·1 answer
  • balance exercises used for introducing balance training should initially involve little joint motion and improve what type of co
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!