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
guapka [62]
3 years ago
10

The function of anOR gate can best be described as a gate which provides an output of 1 only when

Computers and Technology
1 answer:
amid [387]3 years ago
5 0

Answer:

Following are the program to this question:

#include <iostream>//defining header file

using namespace std;

void OR_gate()//defining a method OR_gate

{

bool a,b;//defining bool vaiable

cin>>a>>b;//input value

if(a or b)//use if block to check condition

{

cout<<"1";//print message

}

}

int main()//defining main method

{

OR_gate();//calling method OR_gate  

return 0;

}

Output:

0

1

1

Explanation:

In the above program, a method "OR_gate" is declared, and inside the method two bool variable "a and b" is defined, which input the value from the user end.

In the next step, an if block is defined, that uses the or gate to check input value and print the value that is equal to 1, and inside the main method, it call the "OR_gate" method.

You might be interested in
Write a program consisting of: a. A function named right Triangle() that accepts the lengths of two sides of a right triangle as
Lunna [17]

Answer:

The java program is as follows.

import java.lang.*;

public class Triangle

{

   //variables to hold sides of a triangle

   static double height;

   static double base;

   static double hypo;

   //method to compute hypotenuse

   static double rightTriangle(double h, double b)

   {

       return Math.sqrt(h*h + b*b);

   }

public static void main(String[] args) {

    height = 4;

    base = 3;

    hypo = rightTriangle(height, base);

 System.out.printf("The hypotenuse of the right-angled triangle is %.4f", hypo);

}

}

OUTPUT

The hypotenuse of the right-angled triangle is 5.0000

Explanation:

1. The variables to hold all the three sides of a triangle are declared as double. The variables are declared at class level and hence, declared with keyword static.

2. The method, rightTriangle() takes the height and base of a triangle and computes and returns the value of the hypotenuse. The square root of the sum of both the sides is obtained using Math.sqrt() method.

3. The method, rightTriangle(), is also declared static since it is called inside the main() method which is a static method.

4. Inside main(), the method, rightTriangle() is called and takes the height and base variables are parameters. These variables are initialized inside main().

5. The value returned by the method, rightTriangle(), is assigned to the variable, hypo.

6. The value of the hypotenuse of the triangle which is stored in the variable, hypo, is displayed to the user.

7. The value of the hypotenuse is displayed with 4 decimal places which is done using printf() method and %.4f format specifier. The number 4 can be changed to any number, depending upon the decimal places required.

8. In java, all the code is written inside a class.

9. The name of the program is same as the name of the class having the main() method.

10. The class having the main() method is declared public.

11. All the variables declared outside main() and inside another method, are local to that particular method. While the variables declared outside main() and inside class are always declared static in java.

4 0
3 years ago
Computer gets bored very easily
Gelneren [198K]

Answer:

that is very interesting

Explanation:

5 0
2 years ago
When discussing CV joints, Technician A says that they are called constant-velocity
Alja [10]

A only is correct.

Constant-velocity joints are able to transfer torque with zero angular velocity variation and near-zero vibration to the drive wheels at a constant rotational speed, while still accommodating the up-and-down movement of the suspension. In most cases, they are used in front wheel drive vehicles.

8 0
3 years ago
Which is the right answer
Maksim231197 [3]

Answer:

B

Explanation:

I think.

5 0
3 years ago
Read 2 more answers
The Word program window contains many elements used to create and navigate a document. List five elements of the Word program wi
Veseljchak [2.6K]

Answer:

1. Insert a table

2. Setting margins

3. Spelling and grammar correction

4. Header and footer

5. Search a word

Explanation:

1) A table can be inserted in a word document to manage data easily and in a more presentable way.

2) Different margins can be set according to the requirement and rulers can be made visible and invisible.

3) If by chance typo errors happen, a red wavy line indicates spelling mistakes and green indicates grammar mistakes which can be corrected easily.

4) Sometimes writing some professional documents, we need some text to be visible either on top or bottom of every page of that document which can be done with the help of headers and footers.

5) By pressing Ctrl+f we can easily search for a particular word in a document.

6 0
4 years ago
Other questions:
  • In Word you can _____ or merge two different copies of the same document into one document. a. replicate b. duplicate c. copy d.
    11·1 answer
  • How to eject a flash drive from chromebook?
    6·1 answer
  • In a bubble sort, you use a(n) ____ loop to make pair comparisons.
    5·1 answer
  • Narrowband Satellite Communications supports ______________ data rates for both mobile and fixed users by providing access on a
    8·1 answer
  • A proxy is
    6·1 answer
  • The Python print function
    9·1 answer
  • Which table option enables you to combine the contents of several cells into one cell?
    6·2 answers
  • Plz answer me will mark as brainliest ​
    8·1 answer
  • Bob gets an e-mail addressed from his bank, asking for his user ID and password. He then notices that the e-mail has poor gramma
    6·1 answer
  • Please answer that and i'll gave you branlliest
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!