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
Write an application that prompts a user for two integers and displays every integer between them. Display There are no integers
olga2289 [7]

Answer:

x = int(input("Enter an integer: "))

y = int(input("Enter another integer: "))

if x > y:

   for number in range(y+1, x):

       print(number, end=" ")

elif y > x:

   for number in range(x+1, y):

       print(number, end=" ")

else:

   print("There are no integers between {} and {}".format(x, y))

Explanation:

*The code is in Python.

Ask the user to enter the two integers, x and y

Since we want our program to run regardless of which entered value is larger, we need to compare the numbers to be able to create the loop that prints the numbers.

Check if x is greater than y. If it is, create a for loop that iterates from y+1 to x-1 and print the numbers

Otherwise, check if y is greater than x. If it is, create a for loop that iterates from x+1 to y-1 and print the numbers

If none of the previous part is executed, print that there are no integers between

4 0
3 years ago
Which of the following is not a mobile means of connecting devices to networks?
ElenaW [278]

Answer:

USB cables.

Explanation:

Think of what would happen if you started walking to a friend's house that is 3 houses away from yours. You have a cell and there are no others that you can see. Your friend calls you.

Could you hear what he says with a blue tooth earphone? Likely.

If you are connected by a wifi device. Again likely.

What about a broad band. That would be possible too.

So what about a USB cable. Now there's a problem. The cable would have to be at least 75 feet long (city plots are usually somewhere in the neighborhood of 25 feet wide). You would need an awfully long cable. And that's only 3 houses away.

6 0
3 years ago
Write a program that reads the contents of a file named text.txt and determines the following: The number of uppercase letters i
murzikaleks [220]

Answer:

Explanation:

//Cpp program to count Uppercase, Lowercase, Digits count from file

#include<iostream>

#include<fstream>

using namespace std;

int main()

{

  //ifstream For reading file purpose only

ifstream file("text.txt");

 

  //cheks whether given file is present or not

  if(!file){

      cout<<"File not Found";

      return 0;

  }

  //variables for all three counts and character in file

char character;

int uppercaseCount=0, lowercaseCount=0, digitsCount=0;

  //loop for reading and checkile file character by character

while(file){

      //get a single character

file.get(character);

 

      //checks uppercase character

if((character >= 'A') && (character <= 'Z'))

uppercaseCount++;

     

      //checks lowercase character

 else if((character >= 'a') && (character <= 'z'))

lowercaseCount++;

     //checks lowercase character

      else if((character >= '0') && (character <= '9'))

      digitsCount++;

}

cout<<"\nUppercase characters: "<<uppercaseCount;

cout<<"\nLowercase characters: "<<lowercaseCount;

cout<<"\nDigits: "<<digitsCount;

return 0;

}

/*

content of File text.txt

C++

10.15: Character Analysis Write a program that reads the contents of a file named text.txt and determines the following: The number of uppercase letters in the file The number of lowercase letters in the file The number of digits in the file Prompts And Output Labels. There are no prompts-- nothing is read from standard in, just from the file text.txt. Each of the numbers calculated is displayed on a separate line on standard output, preceded by the following prompts (respectively): "Uppercase characters: ", "Lowercase characters: ", "Digits: ". Input Validation. None.

Output :-

Uppercase characters: 19

Lowercase characters: 434

Digits: 4

*/

3 0
3 years ago
How do you get The special and extended ending in final fight 2 snes
andreev551 [17]
Yes what that person above said!
4 0
3 years ago
If you want to import a picture into a DTP application, what must you do first?
Natasha_Volkova [10]

Answer:

Type a search term that describes the image you want to find in the Search field and press Enter on your keyboard.

7 0
3 years ago
Other questions:
  • In step 2 of the mail merge process you must be prepared to
    6·2 answers
  • Electromagnetic waves used in ovens and cell phone communications are called
    6·1 answer
  • In Vista and Windows 7, the Appearance and Personalization option allows you to change the
    14·1 answer
  • 1. What is Java SE?
    11·2 answers
  • Please answer this a due tomorrow!!!
    5·1 answer
  • A network that typically reaches a few meters, such as up to 10 meters (33 feet), and consists of personal devices such as mobil
    14·1 answer
  • Write the definition of a function named swapints that is passed two int reference parameters. The function returns nothing but
    6·1 answer
  • Write a method called removeInRange that accepts four parameters: an ArrayList of integers, an element value, a starting index,
    11·1 answer
  • True or false windows 98 and windows xp are examples of an operating system?
    12·1 answer
  • The following Python statement instructs the program to open a file for input.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!