General

Chat

Computer science help

Hey guys, well I'm doing a lab right now and just doing the practice questions when I came across a question like this

"Assume that price is an integer variable whose value is the price (in US currency) in cents of an item. Assuming the item is paid for with a minimum amount of change and just single dollars, write an expression for the amount of change (in cents) that would have to be paid. "

I don't really understand how to do this. I don't want you guys to give me the answer but could you rephrase it for me?

September 28, 2012

3 Comments • Newest first

DrHye

Basically think of how many single dollars you can use without exceeding the price, then use quarters to get closer to the price without exceeding it again, dimes, etc

Reply September 28, 2012
timmybitty

It's only the second lab. We're not even done with the basics yet. -.-
I just don't what they mean.

Reply September 28, 2012
lastman28

What the... thats what you're doing in com sci?

Reply September 28, 2012