Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+5 votes

Alright, I'm having trouble with the last problem on the routine practice about the pennies. I don't want direct answers about what to do but are there any hints ppl could provide besides the already given // and % hint?

asked in CSC201 Spring 2021 by (1 point)

1 Answer

+3 votes
Best answer

First, let's consider a different & simpler problem, involving eggs

Suppose you had 28 eggs. How many dozen eggs do you have? 2.

28 // 12 gets you 2 dozen

How many left over (that didn't fit in the 2 cartons of 12)? 4 eggs.

28 % 12 gets you "4 left over"

The pennies/shillings/pounds is a little more complex, since you need to apply this kind of logic twice, but the basic idea is similar!

answered by (508 points)
selected by