Advertisement
RashedBQ

Salary and after New Salary

Aug 2nd, 2021
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fun main(args: Array<String>) {
  2.     var sal =Array<Double>(5){0.0}
  3.     var kk =1
  4.     for (i in 0 until sal.size)
  5.     {
  6.         println("Enter Salary of EMP $kk")
  7.         sal[i]= readLine()!!.toDouble()
  8.         kk++
  9.     }
  10.     var index = 0
  11.     for (i in 0 until sal.size)
  12.     {
  13.         print("Employee Salary Index No $index --> ")
  14.         println(sal[i])
  15.         index++
  16.     }
  17.     println(" ")
  18.     println("Enter the index number for the employee")
  19.     var ix = readLine()!!.toInt()
  20.  
  21.     println("Enter the employee's new salary")
  22.     var newsal = readLine()!!.toDouble()
  23.  
  24.     sal.set(ix,newsal)
  25.  
  26.     println("Employee salaries after adjustment")
  27.     println("|| || || || || || || || || || ||")
  28.     println("VV VV VV VV VV VV VV VV VV VV VV")
  29.     var index2 = 0
  30.     for (i in 0 until sal.size)
  31.     {
  32.         print("Employee Salary Index No $index2 --> ")
  33.         println(sal[i])
  34.         index2++
  35.     }
  36. }
Advertisement
RAW Paste Data Copied
Advertisement