Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun main(args: Array<String>){
- println(getEmployee("some3","Ivan7"))
- }
- fun getEmployee(status: String, name: String) : String{
- if (status == "some"){
- if (name == "Ivan"){
- val currentSalary = 100
- return "Salary of " + status + " " + name + "is " + currentSalary
- }
- if (name == "Alex"){
- val currentSalary = 9999999
- return "Salary of " + status + " " + name + "is " + currentSalary
- }
- } else{
- if (status == "some2"){
- if (name == "Ivan2"){
- val currentSalary = 10000
- return "Salary of " + status + " " + name + "is " + currentSalary
- }
- } else{
- if (status == "some3"){
- if (name == "Ivan3"){
- val currentSalary = 500
- return "Salary of " + status + " " + name + "is " + currentSalary
- }
- if (name == "Ivan7"){
- val currentSalary = 500
- return "Salary of " + status + " " + name + "is " + currentSalary
- }
- } else{
- return "Employee not found"
- }
- }
- }
- return "Something went wrong"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement