What will be displayed after the following statements are executed?
int hours = 30;
Double pay, payRate = 10.00;
Pay = hours <= 40 ? hours*payRate : hours*payRate*2.0;
System.out.println(pay) ;
A) 300.0
B) 600.0
C) 400.0
D) The code contains an error and will not compile.
Correct Answer:
Verified
Q22: The _ statement is used to create
Q23: A _ is a boolean variable that
Q24: What will be the values of ans,
Q25: Which of the following expressions determines whether
Q30: Enclosing a group of statements inside a
Q31: What will be the value of discountRate
Q33: Java requires that the boolean expression being
Q34: Which of the following statements determines whether
Q36: What will be the value of ans
Q39: What will be the value of discountRate
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents