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
What is one reason the number of DUIs has dropped?
nikdorinn [45]

Answer:

Ride Sharing Services

Explanation:

Choosing to take Uber or have a designated driver instead of driving under the influence than have fewer students because fewer people are getting caught diving under the influence.

8 0
3 years ago
In 1-2 sentences, describe some keyboard shortcuts you have used during this lesson to save you time.
Aneli [31]
Command C command V command A
5 0
3 years ago
Read 2 more answers
The IT department at Piggy Parts BBQ has recently learned of phishing attempts that rely on social engineering to break into its
Katen [24]

Answer:

all personnel

Explanation:

According to my research on information technology and cyber security, I can say that based on the information provided within the question this information should be communicated to all personnel. This should be done as a safety precaution, by making all personnel aware of they would know to speak up if they see anything suspicious otherwise they might think an attack is just part of something that the organization is implementing.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

6 0
3 years ago
The four functions of a computer are
ehidna [41]
The four basic functions of a computer are input, processing, output and storage.
6 0
3 years ago
Now, we’re ready to program! Leave the visualizer and go back to https://repl.it/ to write your program. Here is the pseudocode
svlad2 [7]

Answer:

here

Explanation:

6 0
3 years ago
Other questions:
  • What are 3 things that can make cyberbullying especially harmful​
    12·1 answer
  • You want to create a place on a Webpage where you can display graphics, animation, video and games "on the fly" without the need
    7·1 answer
  • Which of the following is considered both an input and output peripheral?
    10·1 answer
  • If your cousin wanted to view information from the world wide web, what application software would you tell her to be sure she h
    11·1 answer
  • Damian uses a modem to connect to a dial-up network. Which statements are true of a modem?
    11·2 answers
  • Please help! 40 points + Brainliest!
    8·1 answer
  • Which of the following is not a natural resource
    11·2 answers
  • Create a while loop to try making a video game turn based battle.
    9·1 answer
  • Hlo Brainlians !!
    11·2 answers
  • Does technology always follow the science,yes or no explain why to choice
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!