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
One key to success in a career is to be an accomplished
Valentin [98]

Answer: The answer is B- Problem Solver.

Explanation:

  • Problem solving is your career is the best way to go. Being able to solve problems while in distress is the best way to go. Solving stuff on your own can make you more successful, and you can improve on mistakes you've made in the past.  
3 0
3 years ago
What is my credit card billing zip code??
Angelina_Jolie [31]
I guessing it should be on the back of the card
5 0
4 years ago
Plz help ASAP
Bogdan [553]

Answer:

D

Explanation:

fiber optic cables are generally used by isps which is why they call their internet fiber optic

8 0
3 years ago
In this question, you must create a function in C++ using an external editor. When satisfied with your work, you shall attach it
RideAnS [48]

Answer:

See explaination

Explanation:

#include<iostream>

#include<map>

using namespace std;

bool contains(int arr[], int size){

map<int,int> nums;

for(int i=0; i< size; i++) nums[arr[i]]=1;

int product;

for(int i=0; i<size-1; i++){

for(int j=i+1;j<size;j++){

product = arr[i]*arr[j];

if (nums[product]==1) return true;

}

}

return false;

}

int main(){

int arr[] ={6,4,-3,-2,0,5};

cout<<boolalpha <<contains(arr,5)<<endl;

return 0;

}

6 0
3 years ago
In what areas is leslie's underspending hurting her
azamat

Answer:

in what areas is leslie's underspending hurting her

Savings

Housing - Yes as investing in housing is a long term saving

Utilities - no this is not a saving, underspending will increase saving

Transportation - no this is not a saving, underspending will increase saving

Groceries - no this is not a saving, underspending will increase saving

Retirement - Yes as investing in Retirement  is a long term saving

Debt Payment -Yes as investing in Debt Payment  is a long term saving

Phone, Cable, Internet - no this is not a saving, underspending will increase saving

Medical Expenses - no this is not a saving, underspending will increase saving

Miscellaneous - accordingly as explained above for each option.

Dining out- no this is not a saving, underspending will increase saving

Explanation:

Please check the answer section.

7 0
3 years ago
Other questions:
  • Mr. Olgesandravich is proctoring students working at their own pace in an online class. He is generating a spreadsheet that show
    15·1 answer
  • ________ is a program that runs on a computer to manage and control a computer's activities.
    11·1 answer
  • No matter what medium connects computers on network-copper wires, fiber-optic cables, or a wireless setup; the same protocol mus
    11·1 answer
  • What are the disadvantages of using pointers?
    6·1 answer
  • The fill command try’s to fill or generate content for cells based on a ________.
    15·1 answer
  • Which network component is used to connect one network to another? Which component delivers the message to the destination compu
    5·1 answer
  • Light the<br> Spark hop<br> Answer if ur a baddie;)))
    9·2 answers
  • Javed’s teacher tells him she would like to see him improve his speaking skills in the next debate by including a rhetorical app
    9·1 answer
  • What should a pie chart represent?
    6·1 answer
  • How does xm satellite deter nonsubscribers from listening to its transmissions? Does this make the radio programing a private go
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!