
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Answer 10 to 12

Transcribed Image Text:11. What is y after the following statement is executed?
x = -1;
y = (x < 0) ? -2 : 3;
а.
-3
b.
-2
с.
3
d.
e. Illegal expression
12. What is the output of the following code?
boolean even = false;
System.out.println((even ? "true" : "false"));
a. true
b. false
c. nothing
d. true false
13. What is Math.floor(3.6)?
а.
3.0
b.
3
с.
4
d.
5.0
14. Which of the following assignment statements is correct?
char c = 'dn';
char c = 100;
char c = 'm';
a.
b.
с.
d.
char c = "100";
15. Which of the following are valid identifiers?
a.
$failure
b.
public
с.
988ht
d.
8=9
е.
radius
![7. To obtain the are sine of 0.5 degree, use
Math.asin(0.5)
Math.asin(Math.toDegrees(0.5))
Math.asin(Math.toRadians(0.5))
Math.sin(0.5)
a.
b.
с.
d.
8. What is the value of the following expression?
true || true && false
true
false
а.
b.
9. What is y displayed in the following code?
public class Testl {
public static void main(String[] args) {
int x = 1;
int y = x = x + 1;
System.out.println("y is " + y);
}
}
a. y is 0.
b. y is 1 because x is assigned to y first.
c. y is 2 because x + 1 is assigned to x and then x is assigned to y.
d. The program has a compile error since x is redeclared in the statement int y = x = x +1
10. Analyze the following program fragment:
int x;
double d = 1.5;
switch (d) {
case 1.0: x = 1;
case 1.5: x = 2;
case 2.0: x = 3;
Which of these is correct about the above code?
The program has a compile error because the required break statement is missing
in the switch statement.
The program has a compile error because the required default case is missing in
the switch statement.
a.
b.
с.
The switch control variable cannot be double.
d.
No errors.](https://content.bartleby.com/qna-images/question/d070c601-43cf-4c7f-b3ee-07dbe2660b26/a24f75d0-22cf-4dae-82cd-25376fce6e6f/y8ibvze_thumbnail.png)
Transcribed Image Text:7. To obtain the are sine of 0.5 degree, use
Math.asin(0.5)
Math.asin(Math.toDegrees(0.5))
Math.asin(Math.toRadians(0.5))
Math.sin(0.5)
a.
b.
с.
d.
8. What is the value of the following expression?
true || true && false
true
false
а.
b.
9. What is y displayed in the following code?
public class Testl {
public static void main(String[] args) {
int x = 1;
int y = x = x + 1;
System.out.println("y is " + y);
}
}
a. y is 0.
b. y is 1 because x is assigned to y first.
c. y is 2 because x + 1 is assigned to x and then x is assigned to y.
d. The program has a compile error since x is redeclared in the statement int y = x = x +1
10. Analyze the following program fragment:
int x;
double d = 1.5;
switch (d) {
case 1.0: x = 1;
case 1.5: x = 2;
case 2.0: x = 3;
Which of these is correct about the above code?
The program has a compile error because the required break statement is missing
in the switch statement.
The program has a compile error because the required default case is missing in
the switch statement.
a.
b.
с.
The switch control variable cannot be double.
d.
No errors.
Expert Solution

arrow_forward
Step 1
let us see the answer:-
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- What is the value in al in a,b,c, and d? mov al,6Bhshr al,1 a. shl al,3 b. mov al,8Ch sar al,1 c. sar al,3 d.arrow_forwardSolve it please with the correct answerarrow_forwardPutting the value 5 into cell number 6 is the same as shifting the contents of cell number 5 into cell number 6, if cell number 5 presently stores the value 8.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education