answer.
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
7nadin3 [17]
1 year ago
12

What is retrieved from a search containing two terms separated by the AND operator?

Computers and Technology
1 answer:
egoroff_w [7]1 year ago
8 0

Answer:

A AND B= 1 or 0

1 1  1

0 1  0

1 0  0

0 0 0

So, as explained above if both are 1 we then only get 1, or else we get 0 always in case of AND which is a logical operator, whose output can be 0 or 1 only. This is being depicted above.

Explanation:

If both are 1 we get 1 or always else, we get the output =0.

You might be interested in
What are the advantages and disadvantages of using a very large memory cell size, say, W = 64 instead of the standard size W = 8
stepladder [879]

Answer and Explanation:

  • The benefits of an large size memory cell is that you can store a lot bigger numbers (and all information is, eventually, numbers) in one cell, which by and large improves the speed and unwavering quality of information get to.  
  • The inconvenience is that you go through a bigger bit of whatever information stockpiling medium you are utilizing on each expression of information, and accordingly can store less information generally speaking.  
  • The biggest positive integer that could be put away in a framework utilizing sign/size documentation, with 64-piece cells is 263. On the off chance that two such cells were utilized to store numbers, the biggest whole number that could be put away by the framework is 2127.
7 0
1 year ago
A shipping company uses the following function to calculate the cost in dollars of shipping based on the weight of the package (
Gwar [14]

Answer:

I am writing the code in JAVA and C++. Let me know if you want the code in some other programming language. Both the programs works the same but the only difference is that i have used logical operator AND (&&) with C++ code to check each condition.

JAVA code:

import java.util.Scanner;    // to take input from the user

public class ShippingCost {  // ShippingCost class

public static void main(String[] args) {   // main method entry to the program

Scanner input = new Scanner(System.in);  //allows to take input from user

System.out.print("please enter the weight of the package: "); /*prompts the user to enter the weight of package.*/

double weight = input.nextDouble();  /*reads and stores the input values(weight) entered by the user*/

       double cost=0;  //holds the value of cost

 if (weight<=0)  /* checks if the user enters weight value less than or equals to 0 */

 { System.out.println("invalid input."); //prints invalid input

     System.exit(0); //exits the program

 }

    else if (weight > 0 && weight <= 1)  /*if weight is greater than 0 and less than or equal to 1*/

   cost = 3.5;  /*if the above condition is true then it stores the value 3.5 in cost variable */

 else if (weight <= 3)  // if value of weight is less than or equal to 3

   cost = 5.5;  /*if the above condition is true then it stores the value 5.5 in cost variable */

 else if (weight <= 10)  // if value of weight is less than or equal to 10

   cost = 8.5;  /*if the above condition is true then it stores the value 8.5 in cost variable */

 else if (weight <= 20)  // if value of weight is less than or equal to 20

   cost = 10.5;/*if the above condition is true then it stores the value 10.5 in cost variable */

 else  // if the value of weight is greater than 20

 {  System.out.println("The package cannot be shipped");

// displays package cannot be shipped

      System.exit(0);  //exits the program if weight>20}

 System.out.println("The shipping cost is: $" + cost);     /*prints the value stored in the cost from any of the above conditions */

} }

C++ Code

#include <iostream>//to use input output functions

using namespace std;

int main() // start of main() function body

{ double weight; //stores weight value

   double cost= 0; //stores cost value

cout << "please enter the weight of the package:" << endl;

//prompts user to enter the weight

cin >> weight;    

//reads the value of weight entered by the user

  if (weight<=0) //if value of weight entered by user is less than or equal to 0

 { cout<<"invalid input."; //displays invalid input

     exit(0); //exits the program

 }

/*the below else if conditions are checked, if any one of them is true then the cost displayed in the output will be the which is assigned to cost variable of that specific if condition's body which evaluates to true. */

    else if (weight > 0 && weight <= 1)

   cost = 3.5;

 else if (weight > 1 && weight <=3)

   cost = 5.5;

 else if (weight > 3 && weight <= 10)

   cost = 8.5;

 else if (weight> 10 && weight <= 20)

   cost = 10.5;

 else //if weight>20

//displays the message below and exits the program

 {  cout<<"The package can not be shipped";

      exit(0); }

 cout<<"The shipping cost is: $"<<cost;  /*displays the value stored in cost variable of that else-if condition which evaluates to true */

}

Explanation:

Everything is well explained in the comments above. I will summarize it all.

The program takes the input weight from the user and checks the value of weight.

If and else-if conditions are used to check the value of weight.

if the value of weight is less than 0 or equal to 0 then invalid input is displayed.

Else the weight value is checked for the given ranges. && operator is used in each else if statement which is used to specify the range of the weight values the input weight should be in order to display the shipping cost.

For example take this statement: else if (weight > 0 && weight <= 1)

This statement checks the value entered by the user that if it lies in the range mentioned in this statement which is that the weight value should be greater than 0 AND less than or equal to 1. The value cannot lie above or below the given range in order for this condition to be true so && operator is used here.

If the weight entered by user exceeds 20 then the message is displayed:The package can not be shipped and the program exits. In JAVA System.exit(0) and in c++ exit(0) function is used to exit the program.

The output of both the programs is as following:

please enter the weight of the package: 3

The shipping cost is: $ 5.5

8 0
1 year ago
In public-key encryption, the two keys–one for coding and one for decoding–are known as ________.
Feliz [49]
Public key and private key  - In public key encryption, a pair of keys is used (public key and private key). The public key can be made available publicly, while the private key is only known  by the owner. The public key is used to encrypt the message, while the private key is used to decrypt the message.
5 0
1 year ago
You're the sole IT employee at your company, and you don't know how many users or computers are in your organization. Uh oh! Wha
Neporo4naja [7]

Answer

Directory Services

<u></u>

<u>Definition</u>

It is a type of software that is used to unify and customize the resources available at the network.

<u>Explanation</u>

This software is used to gather the information and addresses of all computers connected on the network.

It is a type of information store, where all the information related to resources (computer) and services of network has been stored. It also gives administrator rights to the single point to manage whole network resources.

This is the reason, Option "D" is the best choice for me as sole IT employ in a company. I will prefer directory services software to gather the information of all computers of organization and manage users in company.  

4 0
2 years ago
The establishment called ABC Enterprise requires a Java program to keep a database of the inventory of the products that it sell
Alexandra [31]

Answer:

// GetData.java

import javax.swing.JOptionPane;

public class GetData

{

  public static double getDouble(String s)

  {

      return Double.parseDouble(getWord(s));

  }

  public static int getInt(String s)

  {

      return Integer.parseInt(getWord(s));

  }

  public static String getWord(String s)

  {

      return JOptionPane.showInputDialog(s);

  }

  public static String getString(String s)

  {

      return JOptionPane.showInputDialog(s);

  }

}

// Address.java

public class Address

{

  private String street, city, state, zip;

  public Address(String str, String city, String st, String zip)

  {

      street = str;

      this.city = city;

      state = st;

      this.zip = zip;

  }

  public String getStreet()

  {

      return street;

  }

 

  public String getCity()

  {

      return city;

  }

  public String getState()

  {

      return state;

  }

  public String getZip()

  {

      return zip;

  }

}

// Manufacturer.java

public class Manufacturer

{

  private String companyName;

  private Address companyAddress;

 

  public Manufacturer()

  {

      this.companyName = "";

      this.companyAddress = null;

  }

 

  public Manufacturer(String compName, Address address)

  {

      this.companyName = compName;

      this.companyAddress = address;

  }

 

  public String getCompanyName()

  {

      return companyName;

  }

 

  public void setCompanyName(String companyName)

  {

      this.companyName = companyName;

  }

 

  public Address getCompanyAddress()

  {

      return companyAddress;

  }

 

  public void setCompanyAddress(Address address)

  {

      this.companyAddress = address;

  }

}

// Product.java

import java.text.SimpleDateFormat;

import java.util.Date;

public class Product

{

 

  SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");

 

 

  Manufacturer manufacture;

 

 

  String productName;

 

 

  int quantity;

 

 

  double unitPrice;

 

 

  Date productCreated;

 

 

  public Product()

  {

      this.productName = "";

      this.quantity = 0;

      this.unitPrice = 0.0;

      this.productCreated = null;

      this.manufacture = null;

  }

 

  public Product(String prodName, int quantity, double unitPrice,

                        Date productCreated, Manufacturer manufact)

  {

      this.productName = prodName;

      this.quantity = quantity;

      this.unitPrice = unitPrice;

      this.productCreated = productCreated;

      this.manufacture = manufact;

  }

 

 

  public Date getProductCreated()

  {

      return productCreated;

  }

 

 

  public void setProductCreated(Date productCreated)

  {

      this.productCreated = productCreated;

  }

 

  // to get the Manufacturer object

  public Manufacturer getManufacture()

  {

      return manufacture;

  }

 

  // to set the Manufacturer object

  public void setManufacture(Manufacturer manufacture)

  {

      this.manufacture = manufacture;

  }

 

  // to get the name of the product

  public String getProductName()

  {

      return productName;

  }

 

  // to set the name of the product

  public void setProductName(String prodName)

  {

      this.productName = prodName;

  }

 

  // to get the quantity of the product

  public int getQuantity()

  {

      return quantity;

  }

 

  // to set the quantity of the product

  public void setQuantity(int quantity)

  {

      this.quantity = quantity;

  }

 

  // to get the unit price of the product

  public double getUnitPrice()

  {

      return unitPrice;

  }

 

  // to set the unit price of product

  public void setUnitPrice(double unitPrice)

  {

      this.unitPrice = unitPrice;

  }

 

  // to update the quantity of the product

  public void upDateQuantity(int quantity_upDate)

  {

      quantity += quantity_upDate;

  }

 

  // to update the price of the product

  public void upDatePrice(double price_upDate)

  {

      this.unitPrice = price_upDate;

  }

 

 

  public String getProductInfomation()

  {

      String result = "";

      result += String.format("%-30s", productName);

      String dateForm = sdf.format(productCreated);

      result += String.format("\t %s", dateForm);

      result += String.format("%10d", quantity);

      result += String.format("\t%15.2f", unitPrice);

      result += String.format("\t%15s",

                          manufacture.getCompanyName());

      result += String.format("\t%20s",

                 manufacture.getCompanyAddress().getState());

      return result;

  }  

}

Explanation:

  • Create a manufacturer class to store and get information about company name and company address.
  • Create a product class to hold the manufacturer object, product name and other relevant information.
4 0
1 year ago
Other questions:
  • Prove that any amount of postage greater than or equal to 64 cents can be obtained using only 5-cent and 17-cent stamps?
    15·1 answer
  • Use a VLOOKUP function in cell I5 to identify and calculate the federal withholding tax. Use the tax rates from the range D21:E2
    15·1 answer
  • Survey Q, Non-scoring: What role are you playing in your team?
    5·2 answers
  • In the game of $Mindmaster$, secret codes are created by placing pegs of any of seven different colors into four slots. Colors m
    5·1 answer
  • Write a Python function called simulate_observations. It should take no arguments, and it should return an array of 7 numbers. E
    7·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • For any element in keysList with a value greater than 60, print the corresponding value in itemsList, followed by a semicolon (n
    14·2 answers
  • A news channel runs a two-minute story on phishing scams. The report features the testimonies of a phishing victim and a compute
    7·1 answer
  • Complete this truth Table. Write a program that you can enter from the keyboard, a 1 or 0 into three Boolean variables, A,B,C. W
    14·1 answer
  • What is Accenture's role in Multi-party Systems?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!