Question: Which statement is correct about this segment of code? double score = 57.5; int quizScore = 5; double extraCredit = quizScore / 2; System.out.println(grade =

Which statement is correct about this segment of code?

double score = 57.5;

int quizScore = 5;

double extraCredit = quizScore / 2;

System.out.println("grade = " + ((score + extraCredit >=60) ? "pass" : "fail"));

A. It will not compile.

B. it will compile and print pass.

C. It will compile and print fail.

D. It compiles but generate run time error.

Please explain!!!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!