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
File
Degger [83]

Explanation:

formula should add cells D3:07.

Empanadas & More

1

In cell D9 create a formula that calculates the total after a 10% disco

you need help understanding how to take a percentage off of a total

LINE TOTAL

2 MENU ITEM

3 Empanadas: Buffalo Chicken

4 Empanadas: Braised Short Rib

5 Empanadas: Fig and Goat Cheese

6 Sides: Black beans and rice

7

UNIT PRICE

$2.98

$2.98

$3.75

$1.98

QUANTITY

20

30

25

40

TAX

8

TOTAL

6 0
3 years ago
Which type of workplace culture emphasizes the development of new skills?
Archy [21]
Involvement is the answer just took it. thank you

6 0
3 years ago
Read 2 more answers
Why coaxil cable called coxial cable ?
Reika [66]

Answer: Coaxial Cable has got two physical channel layer in same axis of the cable that is why it is known as "coaxial cable".

Explanation: Coaxial cable is the main example for television cable and telephone cable that have two physical layer of channels and are separated by a insulating material layer and the outer layer working a ground section.The axis of both the physical layer are present on the same axis of the cable and thus is known as coaxial cable. They cable is usually made up of copper and some other materials.

7 0
3 years ago
Read 2 more answers
The OnStar system allows Select one: a. a vehicle owner to initiate a conversation with an OnStar representative. b. the vehicle
Rzqust [24]

Answer:  e) a, b, and c

Explanation: OnStar system is the secondary service that is provided by the General Motor Corporation , who is the parent company of this system.The services like in-vehicle protection, diagnosing issues from distance emergency services, communication services based on subscriptions, turn by turn navigation etc.

Conversation started with OnStar member by vehicle owner is communication service in hands -free way, vehicle sending message to OnStar member after mishap/accident is type of emergency services and OnStar member putting off the gas pedal without the permission of driver of the the vehicle is also a protect service .Thus, all the given options are correct.

6 0
2 years ago
Determine and prove whether an argument in English is valid or invalid. About Prove whether each argument is valid or invalid. F
yawa3891 [41]

Answer:

Each understudy on the respect roll got an A.  

No understudy who got a confinement got an A.  

No understudy who got a confinement is on the respect roll.  

No understudy who got an A missed class.  

No understudy who got a confinement got an A.  

No understudy who got a confinement missed class  

Explanation:

M(x): x missed class  

An (x): x got an A.  

D(x): x got a confinement.  

¬∃x (A(x) ∧ M(x))  

¬∃x (D(x) ∧ A(x))  

∴ ¬∃x (D(x) ∧ M(x))  

The conflict isn't considerable. Consider a class that includes a lone understudy named Frank. If M(Frank) = D(Frank) = T and A(Frank) = F, by then the hypotheses are overall evident and the end is counterfeit. Toward the day's end, Frank got a control, missed class, and didn't get an A.  

Each understudy who missed class got a confinement.  

Penelope is an understudy in the class.  

Penelope got a confinement.  

Penelope missed class.  

M(x): x missed class  

S(x): x is an understudy in the class.  

D(x): x got a confinement.  

Each understudy who missed class got a confinement.  

Penelope is an understudy in the class.  

Penelope didn't miss class.  

Penelope didn't get imprisonment.  

M(x): x missed class  

S(x): x is an understudy in the class.  

D(x): x got imprisonment.  

Each understudy who missed class or got imprisonment didn't get an A.  

Penelope is an understudy in the class.  

Penelope got an A.  

Penelope didn't get repression.  

M(x): x missed class  

S(x): x is an understudy in the class.  

D(x): x got a repression.  

An (ax): x got an A.  

H(x): x is on the regard roll  

An (x): x got an A.  

D(x): x got a repression.  

∀x (H(x) → A(x)) a  

¬∃x (D(x) ∧ A(x))  

∴ ¬∃x (D(x) ∧ H(x))  

Real.  

1. ∀x (H(x) → A(x)) Hypothesis  

2. c is a self-self-assured element Element definition  

3. H(c) → A(c) Universal dispatch, 1, 2  

4. ¬∃x (D(x) ∧ A(x)) Hypothesis  

5. ∀x ¬(D(x) ∧ A(x)) De Morgan's law, 4  

6. ¬(D(c) ∧ A(c)) Universal dispatch, 2, 5  

7. ¬D(c) ∨ ¬A(c) De Morgan's law, 6  

8. ¬A(c) ∨ ¬D(c) Commutative law, 7  

9. ¬H(c) ∨ A(c) Conditional character, 3  

10. A(c) ∨ ¬H(c) Commutative law, 9  

11. ¬D(c) ∨ ¬H(c) Resolution, 8, 10  

12. ¬(D(c) ∧ H(c)) De Morgan's law, 11  

13. ∀x ¬(D(x) ∧ H(x)) Universal hypothesis, 2, 12  

14. ¬∃x (D(x) ∧ H(x)) De Morgan's law, 13  

4 0
3 years ago
Other questions:
  • What are some options available when using the Replace feature?
    13·1 answer
  • 5. Why would you want to wear white or light colors on a summer day?
    5·1 answer
  • Combination lock uses three numbers beween 1 and 36 with repetition , how mant combinations are possiable
    6·1 answer
  • Although heart rate increases and decrease depending upon activity level on average a typical person heart rate is about _____ b
    10·1 answer
  • 1. Which of the following should NOT be in a tagline?
    12·1 answer
  • An interface does not have ____.
    13·1 answer
  • Can someone tell me how to get rid of the the orange with blue and orange on the status bar
    14·2 answers
  • I need the answer ASAP. I’ll mark brainliest if right
    5·1 answer
  • A disk drive has 2000 cylinders, numbered 0 to 1999. The drive is currently servicing a request at cylinder 783, with the previo
    6·1 answer
  • 8.1.4: Ghost Invasion!
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!