SHARE
TWEET

Untitled

a guest Nov 14th, 2019 108 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public Raha miinus(Raha vahennettava){
  2.         int eurot = this.euroa;
  3.         int sentit = this.senttia;
  4.        
  5.         if (sentit < vahennettava.sentit()) {
  6.             sentit = 100 + (sentit - (vahennettava.senttia % 100));
  7.             if (vahennettava.senttia > 99) {
  8.                 eurot = eurot - vahennettava.senttia % 100;
  9.             } else {
  10.                 eurot--;
  11.             }
  12.         } else {
  13.             sentit = sentit - vahennettava.senttia;
  14.         }
  15.  
  16.         eurot = eurot - vahennettava.euroa;
  17.        
  18.         if (eurot >= 0 && sentit >= 0) {
  19.             Raha uusi = new Raha(eurot, sentit);
  20.             return uusi;
  21.         } else {
  22.             Raha uusi = new Raha(0, 0);
  23.             return uusi;
  24.         }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top