Advertisement
Guest User

Untitled

a guest
Dec 9th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.37 KB | None | 0 0
  1. //zad.2b
  2. class Time(private var godz:Int,private var minute:Int)
  3. {
  4.     require(godz>=0 && godz<=23 && minute>=0 && minute<60)
  5.     def mm:Int=godz*60+minute;
  6.   def mm_=(y:Int,x:Int)
  7.   {
  8.         require(y>=0 && y<=23 && x>=0 && x<60)
  9.         minute=x;
  10.         godz=y;
  11.   }
  12.   def before(other:Time):Boolean=
  13.       this.godz*60+this.minute<other.godz*60+other.minute
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement