Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Raha miinus(Raha vahennettava) {
- 52
- int eurot = this.euroa - vahennettava.eurot();
- 53
- int sentit = this.senttia - vahennettava.sentit();
- 54
- 55
- if (sentit < 0) {
- 56
- sentit = sentit + 100;
- 57
- eurot = eurot - 1;
- 58
- }
- 59
- 60
- // jos raha menisi negatiiviseksi, palautetaan nolla
- 61
- if (eurot < 0) {
- 62
- return new Raha(0, 0);
- 63
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement