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
Jill edited James's document using Track Changes. James agrees with all of the edits and wants to incorporate them into his text
jenyasd209 [6]
The quick way for James to do so would be : A. open the tools menu, select options, and then select the track changes

with this method, James doesn't have to accept the edits one at a time which will waste his time

hope this helps
4 0
4 years ago
What type of file format is PSD?
Ronch [10]

Answer:

PSD (Photoshop Document)

Explanation:

PSD (Photoshop Document) is an image file format native its one of Adobe's popular Photoshop Application. PSD files are commonly used for containing high quality graphics data.

8 0
3 years ago
Read 2 more answers
Which of the following best describes a situation where software should be upgraded instead of replaced? A three-year-old laptop
Karo-lina-s [1.5K]
The six month old computer that needs more RAM is the answer. it is the only one using software.
6 0
4 years ago
Part 1: Plan and Write the Pseudocode
salantis [7]

lol thats alot of work ill try and get it done before my class starts; (ill edit it)

8 0
3 years ago
Read 2 more answers
Select the correct text in the passage. Idenufy the phrase that shows the use of a non-contact-type temperature sensor. Jim work
suter [353]

Answer:

where he is allowed only to enter on successful biometric verification by sensor at the gate,,it shows to some extent there is no contact,,,the molten we are told is risky so there should be no close contact with it,,

5 0
3 years ago
Other questions:
  • Which of the following commands uses correct syntax for matching the patterns bunk or bank at the end of a line of text?
    5·1 answer
  • What Are some examples of options you can use for bullets? Check all that apply
    14·1 answer
  • Given variables first and last, each of which is associated with a str, representing a first and a last name, respectively. Writ
    13·1 answer
  • Create a Python program that:
    11·1 answer
  • Assume that word is a variable of type string that has been assigned a value. Write an expression whose value is a string consis
    14·1 answer
  • The entress Effie cooks as a chef never vary by taste, quantity or quality
    6·1 answer
  • In C++ please.
    8·1 answer
  • Which of the following are examples of third party software that banks use? (Select all that apply.)
    5·1 answer
  • Sensory cues are used for script writers to be able to get more creative with the story their are scripting for (i.e.
    15·1 answer
  • Directions: Asba student of Contact Center Service, you already have an experience using different computer programs. Try to rem
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!