Guest User

Untitled

a guest
Jul 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. func result(input: String) -> String {
  2. let stuName = ["a","c","h","f","e","i"]
  3. for ja in stuName {
  4. if ja == input {
  5. return ""
  6. }
  7. }
  8.  
  9.  
  10.  
  11. func result2(input2: String) -> String {
  12. let stuPercent = ["93%","75%","65%","58%","43%","Sorry you failed"]
  13. for la in stuPercent {
  14. if la == stuName[0] {
  15. return "Congratulations you! got \(stuPercent[0])"
  16. }
  17. }
  18. return "You can do better! Best of luck for ahead."
  19. }
  20. print("You are a registered member. Please press eneter again and type your name again.")
  21. let presEn: String = readLine()!
  22. print(result2(input2: presEn))
  23.  
  24. return "Sorry! you're not registered"
  25.  
  26. }
  27.  
  28. print("Type your name")
  29. var myName: String = readLine()!
  30. print(result(input: myName))
Add Comment
Please, Sign In to add comment