Skip to content

Instantly share code, notes, and snippets.

@jacobh
Created February 27, 2012 19:04
Show Gist options
  • Save jacobh/1926292 to your computer and use it in GitHub Desktop.
Save jacobh/1926292 to your computer and use it in GitHub Desktop.
Beginning Scala Exercise
class Battery(ampsC: Int, mahC: Int) {
val amps: Float = ampsC
val mah: Float = mahC
def cRating() {
val result = amps * 1000 / mah
result
}
def flightTime() {
val result = 90 / (amps * 1000 / mah)
result
}
}
scala> var b = new Battery(15,1800)
b: Battery = Battery@a8960c5
scala> b.cRating
scala>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment