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]
2 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:
hjlf2 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
How can i repair computer processor?
Lisa [10]
Short answer, you don't. Modern Processors are made up of billions of transistors and are built in multi million dollar factories that have equipment just for that purpose.
8 0
3 years ago
What are the components that make a computer work?
Schach [20]

Answer: Plastic, metal, rubber, wiring, electricity, technology, wifi,  

Explanation: You need  PLASTIC to make a frame for the computer. METAL

to make an exoskeleton under the plastic frame. RUBBER to hold those loose wires and to make sure the electricity doesn't escape and shock you. ELECTRICITY to charge and make the computer runs.  Technology is used for you to log in and out of your computer and WIFI to make sure it doesn't lag.

8 0
2 years ago
Design a finite automata from regular expression 10(0+11)0*1
Vilka [71]
<h3>What is a Finite automata?</h3>

A finite state machine (FSM) or finite state automaton (FSA), or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM may change from one state to another in response to some input; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition. Finite-state machines are of two types - deterministic finite-state machines and non-deterministic finite-state machines. A deterministic finite-state machine can be constructed equivalent to any non-deterministic machine.

With that being said, the DFA is equivalent to the expression 10(0+11)0*1 The expression that you've specified requires at least three 1 to be accepted. Breaking it down into parts.

<h3>Writting the automata:</h3>

<em>S0: 1 => S1        ; 1 </em>

<em>S0: 0 => error     ; 0 </em>

<em>S1: 0 => S1        ; 10+ </em>

<em>S1: 0 => S2        ; 10(0 </em>

<em>S2: 0 => S2 </em>

<em>S2: 1 => S3 </em>

<em>S3: 1 => S4 </em>

<em>S4: 0 => S4 </em>

<em>S4: 1 => S5 </em>

<em>S5: 1 => S6 (final state) </em>

See more about automata at brainly.com/question/14937298

#SPJ1

7 0
1 year ago
Gino has purchased a secondhand laptop. It came preinstalled with various application software and system tools. Which tools can
Jet001 [13]

Answer:

The answer to this question is given below in the explanation section

Explanation:

This question is about matching the column. So, Gino used the various preinstalled application software and system tools for the following purposes.

Disk cleaner: Gino needs to locate unnecessary files that are taking up a considerable amount of space.

Data recovery:  Gino notices many corrupted files and wants to extract good data from them.

Utility diagnostic program: Gino needs to check the operational status of the computer's hardware and software.

Antivirus: Gino's system is acting odd after browsing the internet, and he needs to scan the system.

7 0
3 years ago
C++ <br> see attached file for quesion
sveticcg [70]
The picture doesn’t load.
7 0
2 years ago
Other questions:
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • Individuals with desirable traits will be __________ to have young that survive than individuals without these traits. (2 points
    5·2 answers
  • What were the technological innovations that allowed for the rapid expansion of the railroads?
    6·1 answer
  • You are the network administrator for a company with a single Active Directory domain. The corporate office is located in Miami
    5·1 answer
  • You and your friend who lives far away want to fairly and randomly select which of the two of you will travel to the other’s hom
    6·1 answer
  • What is the output of the C++ codeabove?
    14·1 answer
  • Ayúdenme porfa se los agradecería :c
    7·1 answer
  • Bonjour ma question est: expliquer comment fonctionne une calculatrice qui ne contient pas une pile. Pouvez-vous m'aider?
    12·1 answer
  • How do I use files and functions in programming?
    10·1 answer
  • Phoebe is a Counselor who is trying to schedule a meeting with one of her patients. Which best describes an inappropriate locati
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!