logo Practice-It logo

BJP4 Self-Check 4.19: gpaMessage

Language/Type: Java basics double errors
Author: Marty Stepp (on 2016/09/08)

The following code was intended to print a message when the double gpa variable's value is 3.2, but it actually produces the wrong output. Fix the code to print the expected message.

(The idea here is that the expression 3.2 * 3 in Java does not exactly equal 9.6. You should leave in the computation of the credits variable and should still make your test examine that variable's value, rather than just directly testing the gpa variable itself.)

Type your solution here:


This is a method problem. Write a Java method as described. Do not write a complete program or class; just the method(s) above.

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.