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
What are spreadsheets in a excel workbook called? A. pages B. notepads C.graphs D.worksheets
galina1969 [7]
D. Worksheets
I’m positive this is the correct answer
4 0
3 years ago
A start-up is expanding overseas and spends an excessive amount of time on recruiting and hiring activities, hindering its abili
leva [86]
HCM is a word for Human Capital Management
6 0
3 years ago
Which of the following tasks requires you to use the Tabs option?
Monica [59]
Indenting a paragraph :)
7 0
3 years ago
Identify the causes of configuration problems. (choose all that apply)
jolli1 [7]

Answer: The computer does not meet minimum requirements of the software program because too much energy gets put in it

Explanation:

Good luck

4 0
3 years ago
Read 2 more answers
You realize your computer has been infected with malware. It seems as if someone is controlling your computer from a remote loca
lara [203]

Answer:

Worm malware

Explanation:

The worm operates destructively as it replicates itself and keeps spreading within a computer or network. It takes advantage of software and security vulnerabilities.

Once a computer or network is infected, worms replicate themselves, therefore using up the computer and network resources. Among others, one of the major missions of worms is to create a backdoor into a network, to be able to enable the attacker to carry out a more devastating attack.

Since worms take advantage of weak security in the Operating system, it is very important to constantly update the security features of the Operating system. Users must be careful of the emails they open and attachments they download.

6 0
3 years ago
Other questions:
  • This tag element is the last one used in the html code sequence
    7·1 answer
  • Write a recursive function that calculates if two binary trees are similar?
    14·1 answer
  • PLEASE HELP ME ASAP!!!!
    11·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    10·1 answer
  • Print "Censored" if userInput contains the word "darn", else print userInput. End with newline. Ex: If userInput is "That darn c
    5·1 answer
  • With _______, applications are owned, delivered and managed remotely by one or more providers over the Internet or an intranet,
    15·1 answer
  • An attacker tried to hack into the database of a reputed organization. The attacker inserted malicious code into the query of a
    14·1 answer
  • Robyn needs to ensure that a command she frequently uses is added to the Quick Access toolbar. This command is not found in the
    9·1 answer
  • Use python
    9·1 answer
  • Can you help me with this question please ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!