Newbie BlueJ Bank task help with withdrawals

Hi guys, new to Java

If somebody at a bank did a withdrawal, and were going to be charged at 5% of the total amount, can anybody say how to do this

//

public int calculateFee(int amount)

{

return 5 % amount;

}

//

Thats what I have got so far, and I know it is definatly not right!

How do you do percentages?

Thanks

Re: Newbie BlueJ Bank task help with withdrawals

Quote:

If somebody at a bank did a withdrawal, and were going to be charged at 5% of the total amount, can anybody say how to do this

I guess a first grade student would solve it.

"%" means module.

There is no a percentages sign in java.

Use double and not int, to divide use "/" and to multiply use "*" I hope things are more clear now.

Re: Newbie BlueJ Bank task help with withdrawals

I think you mean modulus. Or is it modulo? Baah just use mod and people know what you mean.