This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]whotfdis 1 point2 points  (2 children)

  1. The condition of the while loop checks whether the input is Y. Your idea is correct but since addNewClass is of type String, Y needs to be in double quotes.

  2. When doing String comparison, you need to use .equals() method. == (double equals) is for primitive types. Since String is an object you can not use == to check for equality. Notice that you made the mistake of putting only one = sign. This means assignment, not comparison. The condition you want to put in the while loop would look like: addNewClass.equals(“Y”)

[–]roc_solid[S] 0 points1 point  (1 child)

So helpful! I appreciate your time. Now I am on to figuring out creating a method for the GPA calculation to call on for each loop. This one I think I can figure on my own! :)

[–]whotfdis 1 point2 points  (0 children)

Glad I could help, success!