Ask your own question, for FREE!
Computer Science 18 Online
kekeman:

You have been asked to create a program for a taxicab company to display the number of riders remaining after filling up their five-person taxicabs. Select the appropriate code. print(riderCount // 5) print(5 // riderCount) print(riderCount % 5) print(5 % riderCount)

kekeman:

Help please

ThisguyKa03:

is this a quiz or an assignment?

ThisguyKa03:

if this is on a quiz or assignment im so sorry i cant help

kekeman:

Wym

Vocaloid:

It wants the *remaining* riders after they’re divided amongst buses of 5 So you want the modulus after the passengers are divided by 5

kekeman:

So it's print(riderCount % 5)

Vocaloid:

Yep

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!