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]
3 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]3 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
Consumers who wish to make a purchase from other consumer on ebay need tl
il63 [147K]

Answer:

Bid on item

Explanation:

Consumers who wish to make a purchase from other consumer on ebay need to first of all bid on the item. This is done by specifying the price in which the purchase should be made.

When this is done, the seller contacts the buyer if he/she’s okay with the price of the goods and services and other formalities are discussed.

8 0
3 years ago
The ____ criteria filter requires the records displayed to start with the specified text string
lys-0071 [83]

The "Begins With" criteria filter is what your looking for

3 0
3 years ago
Hubs connect network hosts in which configuration?
nataly862011 [7]

Answer:

A high availability hub is not required to enable or use the self-describing agent. You can optionally configure a high availability hub for improved availability and recovery if the hub fails. Network Layer – The network layer is responsible for creating a routing table, and based on the routing table, forwarding the input request. Some of the Devices used in the Network Layer are, Routers: A router is a switch-like device that routes/forwards data packets based on their IP addresses.

Explanation:

(hope this helps can i plz have brainlist :D hehe)

8 0
2 years ago
To save a file in word, you can select File, Save (save as), select the location, type the file name, and select save. What is t
Inessa [10]

Answer:

The answer to this question is given below in the explanation section

Explanation:

To save a file in word, you can select File, Save (save as), select the location, type the file name, and select save.

If you want to save the file in word using shortcut. Then, for saving the file, you need to press Ctrl+S. If you want to save the file as (Save as), then you need to press F12.

3 0
3 years ago
Does anyone know about the progressive era?
Umnica [9.8K]

Answer: The Progressive Era was a period of widespread social activism and political reform across the United States that spanned the 1890s to the 1920s.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which two technologies support the building of single-page applications?
    11·1 answer
  • What are examples of some Exotic currencies?
    14·1 answer
  • Carly is part of a community of developers. In her free time, she works on code to improve this open-source operating system. Th
    11·1 answer
  • Which is the best description of the laws governing IT professionals?
    5·1 answer
  • Why are ethics important in PR?
    8·1 answer
  • Use the drop-down menus to complete the statements about printing Contacts. When printing a single contact, go to File and then
    15·1 answer
  • Anyone know how to delete that I need ASAP
    13·1 answer
  • Question #7
    10·2 answers
  • Can you help me with this question please ​
    13·1 answer
  • What is the name of the directory that contains symbolic links to unix sysv rc scripts for runlevel 2?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!