I'm having a hard time thinking about how to code this:
My main trouble is here: there must be one additional eraser for every 20 seats in the classroom.
I understand the first part. I have something like this:
How would I do what I highlighted in bold? I'm thinking it has something to do with an if statement.
At least rephrase this in a way I might understand, because this is a mind twister for me! @_@
Please keep in mind I'm a beginner at Java and I'm only familiar with if/else, whiles, and loop statements. Please don't make this more confusing for me.
/>
minimumErasersNeeded public int minimumErasersNeeded() Calculates the number of erasers needed for this classroom: Each whiteboard must have two erasers, and [b]there must be one additional eraser for every 20 seats in the classroom[/b]. a classroom with one whiteboard and 19 seats would require: 2 erasers for the whiteboard + 0 erasers (because there are less than 20 seats) for a total of 2 erasers. a classroom with two whiteboards and 40 seats would require: 4 erasers for the whiteboards (2 each) + 2 erasers (one for each 20 seats) for a total of 6 erasers. Returns: the calculated number of erasers
My main trouble is here: there must be one additional eraser for every 20 seats in the classroom.
I understand the first part. I have something like this:
numErasers = (iWhiteboards)(2);
How would I do what I highlighted in bold? I'm thinking it has something to do with an if statement.
At least rephrase this in a way I might understand, because this is a mind twister for me! @_@
Please keep in mind I'm a beginner at Java and I'm only familiar with if/else, whiles, and loop statements. Please don't make this more confusing for me.
