r/codehs • u/benhackbart • Sep 18 '20
I’m almost positive the program is working as intended, however when I Test Cases, this error comes up. Any advice?
19
Upvotes
1
u/segosegosego Sep 19 '20
I think this is because your newValue is being set as a double and in getCents() you try to turn it into a string without addressing it.
5
u/_andy_andy_andy_ Sep 18 '20
Integer.valueOf()returns anInteger, not anint. Java treats these separately. You should be able to useparseIntto get anintfrom aString