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
Viet drives around and checks meters to document the amount of electricity used in homes. What Energy pathway is he a part of? E
Svet_ta [14]
As Viet drives around and checks meters to document the amount of electricity used in homes he would be part of the energy distribution process since the electricity is distributed off  a power line into the house and then within the house by the wiring to the lights and the electrical outlets for usage by the inhabitants.
7 0
3 years ago
Read 2 more answers
Which of the following does every font that you choose communicate, either on a conscious or subconscious level?
sergeinik [125]
I believe it is b so I will just leave it at that

3 0
4 years ago
Read 2 more answers
Write the contrapositive of each of the following statements. Healthy plant growth follows from sufficient water. Increased avai
rusak2 [61]

Answer:

Healthy plant growth follows from sufficient water.

Contrapositive: If water is insufficient, then there isn't healthy plant growth

Increased availability of information is a necessary condition for further technological advances

Contrapositive: Absence of further technological advances implies decreased availability of information.

Errors were introduced only if there was a modification of the program.

Contrapositive: If there wasn't any modification of the program then error was not introduced into the program

Fuel savings implies good insulation or storm windows throughout.

Contrapositive: The absence of good insulation or storm windows throughout implies that there is no fuel savings.

Explanation:

A contrapositive statement is formed from a conditional statement as we can see from the answers above.

In a contrapositive statement, we just interchange the hypothesis and the conclusion of the inverse statement.

This implies that, when the converse of the statement is true, then the inverse of the statement is also logically true.

5 0
3 years ago
What is the main purpose of a graphic organizer?
timama [110]
B. To organize information using shapes.
8 0
3 years ago
Read 2 more answers
A technician is configuring the Windows computers on a network to print to a printer that is directly connected to the network v
finlep [7]

Answer:

Network Printer

Explanation:

A network printer is a type of printer that is accessible by network connections, making it available for use by other computers connected to that network. The network can either come from the printer or from a local computer provided to create network for the printer. Most of them contains a network interface card that allow them connect directly to a local network from which computers can then access them. This is different from a local printer that is directly connect to the computer via USB cable.

Network printer is very advantageous in that multiple network computers can access the printer at thesame time.

7 0
3 years ago
Other questions:
  • An essential skill today is knowing how to cite sources properly. Creative Commons has a system of licenses and tools for creato
    11·1 answer
  • Which is the process that a wireless router uses to translate a private ip address on internal traffic to a routable address for
    14·1 answer
  • A risk handling technique in which the organization chooses to simply do nothing, as the cost of the risk being actualized is lo
    15·1 answer
  • Implement function bin2dec that takes a binary number bin_num as a string argument and prints out the corresponding decimal numb
    9·1 answer
  • Why is the ketboard calledQWERTY
    11·2 answers
  • If a function doesn’t return a value, the word _________ will appear as its return type.
    6·1 answer
  • Explain the<br>4 ways<br><br>ways of arranging icons.<br><br>​
    6·1 answer
  • FIRST TO Answer for free brainlest. GOG GOGOGO
    6·1 answer
  • The Ocean Medallion is a wearable device that connects virtually to various devices on board a cruise ship. When a guest is wear
    14·1 answer
  • The Internet is a worldwide communications network. Which device connects computer networks and computer facilities?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!