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
AlekseyPX
3 years ago
8

In C++ please.

Computers and Technology
1 answer:
natali 33 [55]3 years ago
7 0

Answer:

Following are the code to this question:

#include <iostream>//defining header file  

using namespace std;    

bool rightTriangle(int s1,int s2,int s3) //defining method rightTriangle  

{

int t1,t2,t3; //defining integer variables

t1 = s1*s1; // multiplying side value and store it into declaring integer  variables

t2 = s2*s2; // multiplying side value and store it into declaring integer variables

t3 = s3*s3;  // multiplying side value and store it into declaring integer variables

if(t3 == t1+t2)//use if block to check Pythagoras theorem

{

return true; //return true

}

else //else block

{

return false; //return false

}

}

bool equalNums(int n1,int n2,int n3,int n4) //defining method equalNums  

{

if(n1==n3 && n2==n4) //defining if block that checks  

{

return true;//return value true  

}

else //else block  

{

return false; //return value false

}

}

int main()//defining main method

{  

int t1=3,t2=4,t3=5,t11=3,t12=4,t13=5; //declaring integer varibles and assign value  

int check=0;   //defining integer varible check that checks values

if(rightTriangle(t1,t2,t3)&&rightTriangle(t11,t12,t13)) //defining codition to check value using and gate

{

if(equalNums(t1,t3,t11,t13) || equalNums(t2,t3,t12,t13)) // defining conditions to check value using or gate

check = 1; //if both conditions are true

}

if(check==1) //if block to check value is equal to 1

{

cout << "Right Congruent Triangles"; //print message

}

else//else block

{

   cout << "Not Right Congruent Triangles";//print message

}

}

Output:

Right Congruent Triangles

Explanation:

  • In the above-given code, a boolean method "rightTriangle" is declared, in which it accepts three integer variable "s1, s2, and s3" as a parameter, inside the method three another variable "t1, t2, and t3" is declared, in which parameter stores its square value.
  • In the next line, a conditional statement is declared that checks the "Pythagoras theorem" value and returns its value.  
  • In the next step, another method "equalNums" is declared, that accepts four integer parameter "n1, n2, n3, and n4", inside the method a conditional statement is used that uses an operator to check n1, n3, and n2, n4 value if it is true it will return true value else it will return false.
  • Inside the main method, integer variable and a check variable is defined that uses the if block to passes the value into the method and checks its return value is equal if all the value is true it will print the message "Right Congruent Triangles" else "Not Right Congruent Triangles".
You might be interested in
How does the speaker feel about traditional forms of poetry
Salsk061 [2.6K]
A speaker sometimes is not able to capture the intended details since it is affected by homophones.
7 0
3 years ago
Read 2 more answers
Using truth table, prove that:<br><br> (A + B). C = (A . C)+ (B .C) ?
Genrish500 [490]

Answer:

The image of truth table is attached.

Explanation:

In the truth table there is a separate table for the expression (A+B).C and for the expression (A.C)+(B.C) you can see in the truth table that the columns of (A+B).C is having same values as the (A.C)+(B.C).Hence we can conclude that (A+B).C is equal to (A.C)+(B.C).

4 0
2 years ago
1. Which of the following is NOT an example of systems software? (Points : 1)
vladimir2022 [97]
The answer is "operating systems" brcause you need that that to use the rest
' 
4 0
2 years ago
Read 2 more answers
Application software developed by the user or at the user’s request is called ____ software.
Zolol [24]
End-User Software. Because it is not professional

4 0
3 years ago
What is segmentation and paging?
iogann1982 [59]

Over the years, operating systems have sought to be more efficient, which is why it is vital that the use of main memory such as ram be as intelligent as possible, so that operating systems are more efficient.

Segmentation is a process of dividing the program into logical units, such as sub functions, arrays, variables, etc., making it possible to have processes divided into pieces so that it is easy to access each of the processes that this leads to its execution. Segmentation allows the programmer to contemplate the memory as if it had several address spaces or segments. References to memory consist of an address of the form segment number - offset.

Pagination is a technique where memory space is divided into physical sections of equal size, called page frames. The programs are divided into logical units, called pages, that are the same size as the page frames. In this way, an information page can be loaded in any page frame. The pages serve as an information storage unit and transfer between main memory and auxiliary or secondary memory. Each frame is identified by the frame address, which is in the physical position of the first word in the page frame.

8 0
2 years ago
Other questions:
  • Which is NOT a type of SD card?
    8·2 answers
  • Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
    13·1 answer
  • What is the slide sorter view used for?
    11·1 answer
  • Which of the following actions might contribute to recommendations you see online?
    6·1 answer
  • 6 external parts of computer
    10·2 answers
  • If you were infiltrating a network (10.16.0.0/16), and searching for vulnerabilities (while trying to remain undetected), why wo
    11·2 answers
  • What are the OSHA construction standards also called ?
    10·1 answer
  • Select the best answer to the following question.
    5·1 answer
  • Importancia del sistema operativo
    6·1 answer
  • When right-clicking an object, a ____ menu appears, which contains frequently used commands related to the object.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!