Advertisement
mehedi2022

Methods Examples

Sep 8th, 2022 (edited)
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.34 KB | None | 0 0
  1. //BMI calculator
  2. def bMI(mass: Int , weight: Double) =
  3.   val result = mass/(weight*weight)  
  4.   println(s"BMI : $result")
  5.  
  6. bMI(110,1.8034)
  7.  
  8. // celcious and ferhenhit calculator
  9. def temparature ( ferhenhit: Int) : Unit =
  10.   val c = (ferhenhit-32)*5/9
  11.   println(s"I am in fever & my boody temparature is $c degree celcius")
  12.  
  13. temparature (104)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement