In: Computer Science
object MyClass {
def main(args: Array[String]) {
// reading float value
var atm = scala.io.StdIn.readFloat()
// convertion of pressure to other units
var psi = atm * 14.6956
var torr = atm * 760
var pascal = atm * 101325
var bar = atm * 1.01325
// printing pressure
println("Pressure : " + atm + " ATM")
println("Convert To PSI : " + psi + " PSI")
println("Convert To Torr : " + torr + " Torr")
println("Convert To Pascal : " + pascal + " Pascal")
println("Convert To Bar : " + bar + " Bar")
}
}
Code
Output