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
ehidna [41]
4 years ago
6

What will the following program display?

Computers and Technology
1 answer:
s344n2d4d5 [400]4 years ago
5 0

Answer:

0 1 1 0

Explanation:

Running the below code

#include <iostream>

using namespace std;

int main() {

   int a = 0, b = 2, x = 4, y = 0;

   cout << (a == b) << " ";

   cout << (a != b) << " ";

  cout << (b <=x) << " ";

  cout << (y > a) << endl;

   return 0;

}

line 5 = states is a == b, i.e 0 == 2, which returns false 0

line 6 = states is a != b i.e 0 not equal to 2 returns true 1

line 7 = states is b <= x i.e 2 less than or equal to 4 returns true 1

line 8 = states is y >a i.e 0 > 0 returns false 0

You might be interested in
What is output? x = 10 if (x &gt; 10): print(1) elif (x = 10): print(3) else: print(4)
nikdorinn [45]

Answer:

There are three logical operators: and, or, and not. The semantics (meaning) of these operators is similar to their meaning in English. For example, x > 0 and x < 10 is true only if x is greater than 0 and less than 10.

n % 2 == 0 or n % 3 == 0 is true if either of the conditions is true, that is, if the number is divisible by 2 or 3.

Finally, the not operator negates a boolean expression, so not(x > y) is true if (x > y) is false, that is, if x is less than or equal to y.

Explanation:

3 0
3 years ago
Suppose that you are asked to modify the Stack class to add a new operation max() that returns the current maximum of the stack
Advocard [28]

Answer:

Following are the code to the given points:

Explanation:

For point 8.1:

public String max()//defining a method max

{

   String maxVal=null;//defining a string variable that holds a value

   for(int x=0;x<n;x++)

   {

       if(maxVal==null || a[i].compareTo(maxVal)>0)//defining if blok to comare the value

       {

           maxVal=a[i];//holding value in maxVal variable

       }

   }

   return maxVal;//return maxVal variable value

}

For point 8.2:

public void push(String item)//defining a method push that accepts item value in a parameter

{

       a[n]=item;//defining an array to hold item value

       if(n==0 || item.compareTo(maxVals[n-1])>0)//use if to comare item value

       {

               maxVals[n]=item;//holding item value in maxVals variable

       }

       else

       {

               maxVals[n]=maxVals[n-1];//decreasing the maxVals value

       }

       n++;//incrementing n value

}

public String pop()//defining a method pop

{

       return a[--n];//use return value

}

public String max()//defining a method max

{

       return maxVals[n-1];//return max value

}

  • In the first point, the max method is declared that compares the string and returns its max value.
  • In the second point, the push, pop, and max method are declared that works with their respective names like insert, remove and find max and after that, they return its value.
7 0
3 years ago
Angelika just submitted her product for the first time, and she had 2 errors, 3 warnings, and 5 notifications. What does she nee
KonstantinChe [14]

Answer:

Errors.

Explanation:

Angelika should focus on fixing the errors so that her ads can be shown. Because of the errors the code will not compile fully either be it run time error or compile time error or syntax error or any other error.

Warnings shows the potential problems but the code will run even if there are warnings and the notifications are not to worry about.

4 0
3 years ago
Which of the following should get a Page Quality (PQ) rating of Low or Lowest? Select all that apply. True False A page with a m
Vikki [24]

The statement “All queries have only one intent: Know, Do, Website or Visit-in-Person intent” is True.

The statement “The intent of a Do query is to accomplish a goal or engage in an activity on a phone” is True.

The statement “The intent of a Website query is to find information” is True.

The statement “There is absolutely no information about who is responsible for the content of the website on a YMYL topic” is True.

The statement “All the Main Content(MC) of the page is copied and created with deceptive intent” is True.

The statement “A page with a mismatch between the location of the page and the rating location; for example, an English page for an English rating task’ is True.

“A file type other than a web page, for example; a PDF, a Microsoft Word document or a PNG file” is False.

<u>Explanation:</u>

The searcher tries to find out the Know queries. The action is taken by the searcher using the Do queries. The searcher looks for a site/ page using Website queries. The queries which are the same as they appear to be are Visit-in-Person queries.

The statement is true because in Do queries, the action is taken like the control of the smartphone is given to Google.

The search for a page or a site takes place using Website queries.

It is not always true that the Wikipedia pages should get high ratings for all user intents because information is helpful.

There is no surety that who will update the content of the website on a YMTL topic.

The Main Content (MC) of the low quality YMYL page helps the page to achieve its purpose. For YMYL the content is created with deceptive intent. The pages manipulate users to take action which will not help the users .

The PQ rating is lowest when there is a mismatch between the location of the page and the rating location, for example, an English rating task. Here, the purpose of the page is required to be understood to determine the rating.

The PQ rating is not determined by the type of the page but by the purpose of the page.

6 0
4 years ago
Which of the following describes computer animation Select one of the options below as your answer:
Tresset [83]
I think it is B
--------------
4 0
3 years ago
Read 2 more answers
Other questions:
  • You need to put cabling for connecting two new computers in a room, which did not have any network infrastructure. Because of th
    9·2 answers
  • (True or False)
    8·2 answers
  • Which type of wireless network is<br> controlled through a wireless<br> access point?
    7·1 answer
  • Makes it possible to distribute both power and data using ethernet cabling. select one:
    12·1 answer
  • When aJSP page is compiled, what is it turned into?AppletServletApplicationMidlet
    14·1 answer
  • Identify the problems that computer program bugs can cause. Check all that apply.
    9·2 answers
  • What is the speed of Android operating system?
    6·1 answer
  • A malicious user in your organization was able to use the Trinity Rescue Kit to change the password on a department manager's co
    7·1 answer
  • ______ is a type of specialized expansion bus used to connect audio and video equipment to the computer.
    10·1 answer
  • You have two identical print devices that are set up in a work room. Currently, the Windows print server has two printers config
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!