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
uranmaximum [27]
3 years ago
10

3. Write a program to find the area of a triangle using functions. a. Write a function getData() for user to input the length an

d the perpendicular height of a triangle. No return statement for this function. b. Write a function trigArea() to calculate the area of a triangle. Return the area to the calling function. c. Write a function displayData() to print the length, height, and the area of a triangle ( use your print string) d. Write the main() function to call getData(), call trigArea() and call displayData().
Computers and Technology
1 answer:
hjlf3 years ago
4 0

Answer:

The program in C++ is as follows:

#include<iostream>

using namespace std;

void displayData(int height, int length, double Area){

   printf("Height: %d \n", height);

   printf("Length: %d \n", length);

printf("Area: %.2f \n", Area);

}

double trigArea(int height, int length){

double area = 0.5 * height * length;

   displayData(height,length,area);

   return area;

}

void getData(){

   int h,l;

   cin>>h>>l;

   trigArea(h,l);

}

int main(){

   getData();

   return 0;

}

Explanation:

<em>See attachment for complete program where comments are used to explain the solution</em>

Download cpp
You might be interested in
Hi guy how do i make money in app cuz im desperate for 1 right now​
Margarita [4]

Answer:

we need context

Explanation:

7 0
3 years ago
Read 2 more answers
What is the biggest type of gear?<br><br>A. Spur<br>B.Worm<br>C.Wheel<br>D.Pinion
AnnZ [28]
The answer to this should be B. Worm. A pinion is a the smallest gear out of the listed ones above. spur would be next then wheel and the biggest if them all would be the spur. I'm not completely sure if my answer is 100% correct, but I feel confident enough about it. Hope this helps. :)

7 0
2 years ago
Read 2 more answers
When inserting a fly in animation what is the first step in the process?
marishachu [46]

Answer:

The answer: select the element you wish to animate.

Explanation:

4 0
3 years ago
NFPA 780, Standard for the Installation of Lightning Protection Systems provides information on the installation of _____ for li
Andrews [41]

Answer:

a and b. 250.4(A)(1) Note

Explanation:

4 0
2 years ago
What statement is used to close a loop started with a for statement?
liraira [26]
If I get what you are saying then you could use a work like end. :)
5 0
3 years ago
Other questions:
  • If a class has member variables that are pointers, you must ensure that you implement ____.
    6·1 answer
  • The Apple II is an IBM-compatible PC "clone".<br> True?<br> False?
    10·1 answer
  • Mengapakah wanita hamil memerlukan jumlah nutrien yang lebih banyak berbanding wanita tidak hamil.
    10·1 answer
  • A packet analyzer is a program that can enable a hacker to do all of the following EXCEPT ________. Select one: A. assume your i
    6·1 answer
  • Which of these is the most likely result if the internet download speed in your home is 25 Mbps?
    14·1 answer
  • The _device provides a means of communication between a computer and outer world.​
    14·1 answer
  • Write an application that determines which, if any, of the following files are stored in the folder where you have saved the exe
    10·1 answer
  • Generally speaking, the _______ the risk, the _______ the potential return or loss
    8·2 answers
  • What are the advantages of mine shaft gear and the disadvantaged​
    9·1 answer
  • Which of the following recommendations should you follow when placing access points to provide wireless access for users within
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!