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
If an M:N relationship is mandatory on both sides, and if both relations resulting from the entities involved in the relationshi
vivado [14]

Answer:

0

Explanation:

In the problem above, the relationship that exists between M and N is discovered to be on each side of the system. Furthermore, it was stated that the outcome of the relationship also has approximately 3 records. This shows that there is no record for the bridge that is formed as a result of the relationship.

4 0
3 years ago
Write a program to accept radius and find area of circle
Ilya [14]

Answer:

Change it however you'd like

Explanation:

from math import pi

def findArea(rad):

   return (rad**2) * pi

#test

print(f"Area of the circle: {findArea(5)}")

8 0
2 years ago
Read 2 more answers
Biometric devices are often associated with computer and data security. True False
Leya [2.2K]

Answer:

True

Explanation:

5 0
3 years ago
Place the following STEM inventions in the correct chronological order, from the earliest to the most recent discovery.
sukhopar [10]
Probably C

If I’m right, can you mark me brainliest please?
5 0
3 years ago
Read 2 more answers
When scanning the road, glance away from the road ahead for ___. A. At least one second B. No more than one second C. At least t
Marrrta [24]
A.At least one second
5 0
3 years ago
Other questions:
  • The CPU package is installed using the ____ process
    7·1 answer
  • What type of control structure is the default method of the computer reading code?
    9·1 answer
  • Assume that there is a class called BankAccountHolder that represents an individual member of a bank. There is also a BankAccoun
    5·2 answers
  • 1| def saveUserProfile(firstName, lastName, age, height, country):
    7·1 answer
  • When you open a program, the hard drive___
    6·1 answer
  • How do you copy and paste a screenshot on an hd computer
    12·2 answers
  • Which advertising medium has the widest reach on a global front?
    12·1 answer
  • The act of illegally copying software, music,or movies that are copied protect?
    7·2 answers
  • What is the diffrent between ibm pc and ibm compatibles in table:​
    11·1 answer
  • Which compound is obtained by the oxidation of primary alcohol with nascent oxygen​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!