Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.25 KB | None | 0 0
  1. fun main(args: Array<String>){
  2.  
  3.     println(getEmployee("some3","Ivan7"))
  4. }
  5.  
  6. fun getEmployee(status: String, name: String) : String{
  7.  
  8.     if (status == "some"){
  9.         if (name == "Ivan"){
  10.             val currentSalary = 100
  11.             return "Salary of " + status + " " + name + "is " + currentSalary
  12.         }
  13.         if (name == "Alex"){
  14.             val currentSalary = 9999999
  15.             return "Salary of " + status + " " + name + "is " + currentSalary
  16.         }
  17.     } else{
  18.         if (status == "some2"){
  19.             if (name == "Ivan2"){
  20.                 val currentSalary = 10000
  21.                 return "Salary of " + status + " " + name + "is " + currentSalary
  22.             }
  23.         } else{
  24.             if (status == "some3"){
  25.                 if (name == "Ivan3"){
  26.                     val currentSalary = 500
  27.                     return "Salary of " + status + " " + name + "is " + currentSalary
  28.                 }
  29.                 if (name == "Ivan7"){
  30.                     val currentSalary = 500
  31.                     return "Salary of " + status + " " + name + "is " + currentSalary
  32.                 }
  33.             } else{
  34.                 return "Employee not found"
  35.             }
  36.         }
  37.     }
  38.     return "Something went wrong"
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement