The following code snippet contains an error. What is the error?
If (cost > 100) ;
{
Cost = cost - 10;
}
System.out.println("Discount cost: " + cost) ;
A) Syntax error (won't compile)
B) Logical error: use of an uninitialized variable
C) Logical error: if statement has do-nothing statement after if condition
D) Logical error: assignment statement does not show equality
Correct Answer:
Verified
Q1: What is the output of the following
Q2: What is the output of the following
Q2: Which of the following statements is true
Q3: Assuming that the user provides 303 as
Q5: Assuming that a user enters 25 as
Q9: What kind of operator is the <=
Q9: Which of the following statements is (are)
Q10: Suppose one needs an if statement to
Q11: Assuming that the user provides 99 as
Q19: The operator !> stands for
A)not less than.
B)not
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