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
dolphi86 [110]
3 years ago
8

Write a program that prompts the user for the lengths of the two legs of a right triangle, and which reports the length of the h

ypotenuse. Recall that the hypotenuse length satisfies the formula:
c =√ (a² + b²)
Computers and Technology
1 answer:
timurjin [86]3 years ago
3 0

Answer: The following code is in c++

#include <iostream>

#include<math.h>

using namespace std;

int main()

{

   float a,b,c;

   cout<<"Enter height and base of triangle\n";

   cin>>a>>b;  //reading two sides from user

   c=sqrt(pow(a,2)+pow(b,2));  //calculating hypotenuse

   cout<<"Length of hypotenuse is "<<c;  //printing third side of triangle

   return 0;

}

OUTPUT :

Enter height and base of triangle                                                                                            

3                                                                                                                              

4                                                                                                                              

Length of hypotenuse is 5  

Explanation:

In the above code, three variables a, b and c of int type are declared. After that, it is asked from user to enter the value of a and b. The user puts the value and then c is calculated with the help of Pythagoras theorem formulae which squares the values of two sides and then adds them to calculate hypotenuse of a right angled triangle and finally c is printed to console.

You might be interested in
The main purpose of a honeypot is Select one:
masya89 [10]

Answer:

d. To help security professionals better understand and protect against threats to the system

Explanation:

The main purpose of a honeypot is to attract potential hackers and allow them to have access to a network system that is not the actual live network with close monitoring. This is done so as to learn and understand the intentions of the hacker and how they execute an attack. With this knowledge security professional are in a better position to deal with potential threats and keep the network secure.

4 0
3 years ago
An indication of delayed fuel ignition could be​
Sophie [7]

Answer:

The ignition delay in a diesel engine is defined as the time interval between the start of injection and the start of combustion. This delay period consists of (a) physical delay, wherein atomisation, vaporization and mixing of air fuel occur and (b) of chemical delay attributed to pre-combustion reactions. Physical and chemical delays occur simultaneously.

Hope This Helps!     Have A Nice Day!!

6 0
3 years ago
What is an electronic medical record
Airida [17]
EGC . medical research science
3 0
3 years ago
Write the printItem() method for the base class. Sample output for below program:
Anna [14]

Answer:

The printItem() method code is filled in the explanation, highlighted with bold font.

Explanation:

// ===== Code from file BaseItem.java =====

public class BaseItem {

  protected String lastName;

  public void setLastName(String providedName) {

      lastName = providedName;

      return;

  }

// FIXME: Define printItem() method

/* Your solution goes here */

  public void printItem() {

      // TODO Auto-generated method stub

      System.out.println("Last name: "+lastName);

  }

}

// ===== end =====

4 0
2 years ago
What is the numeric range of a 16-bit twos complement value? A 16-bit excess notation value? A 16-bit unsigned binary value?
blagie [28]

Answer:

twos complement value is (-2^15 -1) -32768 to 32767.

excess notation value is -32768 to 32767.

unsigned binary value is (2^16) 0 to 65535

Explanation:

Excess notation: used to represent signed integers. Always uses fixed number of bits with leftmost representing the sign.

Twos complement notation: As opposed to excess notation, a sign bit of 0 is used to represent the non-negative (+) sign and a 1 for the negative (-); again, zero is included in the non-negative set.

Unsigned Binary values: are binary values/bits that don't have signs

7 0
3 years ago
Other questions:
  • What is the best Graphics Card you can get in a Gaming Computer? Also what is the RAM do in a Comptuer
    6·1 answer
  • When a speaker is finished talking, you should allow for _____.
    14·2 answers
  • List of steps to apply bold and italic formatting to a word​
    9·2 answers
  • Write a class called SimpleSquare that has the following properties: - public int field called num - private int field called sq
    13·1 answer
  • Assign a variable solveEquation with a function expression that has three parameters (x, y, and z) and returns the result of eva
    6·1 answer
  • Which menu would most likely allow you to choose a font A.file B.Edit C.format D.insert​
    5·1 answer
  • Assume variables SimpleWriter out and int n are already declared in each case. Write a while loop that printsA. All squares less
    11·1 answer
  • What would happen if computers only had input devices?
    9·1 answer
  • Professor Gig A. Byte needs to store text made up of the characters A with frequency 6, B with frequency 2, C with frequency 3,
    10·1 answer
  • Select the correct answer.<br> What do you understand by "exposition"?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!