1

enter image description here

Hi! keep getting this error in my code

Could someone kindly help me figuring out whats wrong?

Thank you :)

1
  • Hi. For future questions, could you please cut and paste your code instead of using screen shots? Code usually needs to be tested, but nobody transcribes code from screenshots. ;-)
    – Cliff B
    Aug 25 '20 at 2:32
2

It's a simple problem and the same issue in all cases.

The code is trying to do dollar % 25 BUT, dollar is a float, not an int. The modulo operator requires both operands to be integers. Modulo cannot be applied to a float.

Maybe you meant to use owed instead? You'll need to declare owed before the do/while loop for it to stay in scope though.

If this works (looks like it does, I haven't tested), kudos to you. This looks like one of the most creative versions I've seen! Nicely done! [Edit] But after looking more closely, not quite the most efficient. You'll learn more about that in later lessons. ;-)

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .