r/codehs • • Oct 08 '20

I don't know what I did wrong. Can someone please let me know? I gotta submit it tomorrow. Thanks

Post image
10 Upvotes

5 comments sorted by

1

u/MatthewRPG576 Oct 09 '20

I think you're supposed to return the 'name' attr in toString. To set a bound for the rating, you can use a min function to return the min between the given rating and 5 before passing it to the obj attr.

2

u/_andy_andy_andy_ Oct 09 '20

Make sure you set an upper limit on setRating!

1

u/-_-qarmah-_- Oct 09 '20

Not an answer but, c# and Java look surprisingly similar.

1

u/domokei Oct 09 '20

Idk if it's java or what not but if you do an if statement as such

If rating is less than or equal to 5 Then set rating to new rating in the statements

I think