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
On a system with paging, a process cannot access memory that it does not own. Why? How could the operating system allow access t
kompoz [17]

Answer:

  • Because the page is not in its page table
  • The operating system could allow access to other memory by allowing entries for non-process memory to be added to the process page table

Explanation:

On a system with paging, a process cannot access memory that it does not own because the page is not in its page table also the operating system controls the contents of the table,therefore it limits a process of accessing to only the physical pages allocated to the process.

The operating system could allow access to other memory by allowing entries for non-process memory to be added to the process page table.that way two processes that needs to exchange  data can efficiently do that . i.e creating a very efficient inter-process communication

7 0
3 years ago
(tco 2) c++ comments are represented by which characters?
Margarita [4]
(TCO 2) In C++ terminology, (Points : 4) a ... a class object is the same as a class instance. a class object is the same as a class member. a class object is the same as a class access specifier.
4 0
3 years ago
Accessing a web site in search of magazine articles about a product before its purchase is an example of what part of the consum
GaryK [48]

Accessing a web site in search of magazine articles about a product before its purchase is an example of<u> information seeking.</u>

<u />

<h3>Why knowledge seeking is important?</h3>

Information seeking as a social phenomenon has been instrumental in identifying how academics disseminate new ideas and comment on existing research. Observing how academics make informed choices, and identify resources and strategies to stay on top of the publications is an important element of academic research.

<h3>What are information-seeking Behaviours?</h3>

Information-seeking behavior is the act of actively seeking information to answer a specific query. Information-searching behavior is the conduct which stems from the searcher interacting with the system in question.

To learn more about Information seeking, refer

brainly.com/question/1382377

#SPJ4

3 0
2 years ago
What technique is used to separate the different cell parts?
Brut [27]
This should be in Science/Biology
5 0
3 years ago
In an If-Then-Else statement, the Else clause marks the beginning of the statements to be executed when the Boolean expression i
kari74 [83]

Answer:

False

Explanation:

The definition for the If-Then-Else structure is as follows:

IF (<em>boolean_condition</em>)  

THEN (<em>commands_for_true</em>)  

ELSE (<em>commands_for_false</em>)

When there is an ELSE sentence, its commands are to be executed whenever previous conditions where not evaluated as true .

7 0
3 years ago
Other questions:
  • Why is it helpful hat the ribbon tabs can collapse
    10·1 answer
  • Which component of the Hyper-V architecture controls all communication with the physical hardware on the computer?
    8·1 answer
  • Given two variables , first_place_winner and second_place_winner, write some code that swaps their associated values. use any ad
    12·1 answer
  • What is it called when a additional document is added to an email
    13·2 answers
  • Your computer monitor’s power switch is in the ‘ON’ position; however, the display is blank. Which of the following is NOT a lik
    5·1 answer
  • This is used to copy information from cell to cell in the spread sheet
    7·1 answer
  • Jack is part of the software quality assurance team in a company. Which activity should Jack perform as a part of software quali
    11·1 answer
  • Who used the term" software" first?
    8·2 answers
  • Why might a programmer want to define his or her own functions? What are some potential disadvantages? How might new functions m
    10·1 answer
  • Change the file name for index.html to index.php
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!