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
select all examples of proper keyboarding technique. rest your fingers gently on the home row or home keys. slouch in your chair
padilas [110]

Rest your fingers gently on the home row or home keys.

Rest your palms on the keyboard.

Relax your fingers.

All the above are proper keyboard techniques apart from slouch in your chair. It is always recommended to sit up straight with your feet positioned on the floor for balance. Do not cross. Center your body to the H key and have your elbows at sides and bent about 90 degrees. Use correct fingering and deploy touch typing. These and many others will help develop optimal speed and accuracy and help prevent the development of stress injury.

6 0
3 years ago
Read 2 more answers
Which power backup method will continually provide power to a server if the power goes out during a thunderstorm
ohaa [14]

Answer:

An online UPS

Explanation:

An online uninterrupted power supply (ups) can be defined as an electronic device that is designed to supply continuous power to a load that uses alternating current (AC), through the inverter and rectifier arrangement (combination) during normal operation of the device. Thus, an online UPS through its inverter supplies continuous AC power in the event of a power failure.

Hence, an online UPS power backup method is designed and developed to continually provide power to a server (load) if there is a power outage as a result of a thunderstorm.

In conclusion, an online uninterrupted power supply (ups) guarantees a 24 hour power supply when properly installed and connected to a load or end user device such as a server.

5 0
3 years ago
Which of the last step in conducting a URL search
kipiarov [429]
The user's browser renders the html code as a visual web page. A web page that we commonly see is structured by a bunch of 1 and 0. Rendering process allow the machine to interpret that 1 and 0 into the visual that we currently seeing Hope this helps. Let me know if you need additional help!
6 0
3 years ago
Name a network device which would have to be
VMariaS [17]

Answer:

network interface card (NIC).

4 0
3 years ago
We want to implement a data link control protocol on a channel that has limited bandwidth and high error rate. On the other hand
Korolek [52]

Answer:

Selective Repeat protocols

Explanation:

It is better to make use of the selective repeat protocol here. From what we have here, there is a high error rate on this channel.

If we had implemented Go back N protocol, the whole N packets would be retransmitted. Much bandwidth would be needed here.

But we are told that bandwidth is limited. So if packet get lost when we implement selective protocol, we would only need less bandwidth since we would retransmit only this packet.

6 0
3 years ago
Other questions:
  • This toolbar has icons representing the application's basic operations such as Save and Copy. Drawing Formatting Standard Task
    11·2 answers
  • PLEASE HELP! Which aspect helps you to change the luminescence of your image?
    10·2 answers
  • Money from a Coverdell Education Savings Account can be used for:
    11·1 answer
  • 1) Why is angle of view important? What are some of the ways that you can do this?
    6·1 answer
  • How can I, fill the application form for jobs. [such as Macdonal's jobs].?
    12·1 answer
  • Given a number count the total number of digits in a number
    12·1 answer
  • The four smallest numbers (40 points) Write an ANNA assembly program (smallest_four.ac) that finds the four smallest numbers ent
    11·1 answer
  • Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
    7·1 answer
  • What relationship do MP3s and MP3 players have with video files?
    11·1 answer
  • Use a for loop to output the numbers from 50 to 65
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!