Given that x = 2, y = 1, z = 0, what will the following cout statement display?

cout << "answer = " << (x || !y && z) << endl;

a. answer = 0
b. answer = 1
c. answer = 2
d. None of these


b. answer = 1

Computer Science & Information Technology

You might also like to view...

A domain name ends with an extension that indicates its bottom-level domain.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Write a function that reads delimited strings from a file with names and phone numbers and uses a database to store the names as the keys and the phone numbers as the values. Take as input the filename and the name of the person who’s phone number you are looking for. How would you look up the phone number to find the name it belongs to?

Note: This question does not specify the type of delimited strings to use, but the most common assumption would be a comma-delimited string. By relational database it could mean a relational database with hash tables, like in Program 165, or a MySQL database. The former would lead to an answer like findPhoneNumber, and the latter would lead to an answer like findPhoneNumber2. To answer the question, you would look up the phone number to find the name it belongs to by checking each of the keys to see if its value matches the phone number, then returning that name.

Computer Science & Information Technology

Class JTextArea’s getSelectedText method ________.

a. returns the text in the JTextArea b. returns the selected text in the JTextArea c. displays only the selected text in the JTextArea d. sets the selected text in the JTextArea

Computer Science & Information Technology

You can use CSS styles to add properties such as text indents, padding, and margins when formatting text in div tags.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology