Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func result(input: String) -> String {
- let stuName = ["a","c","h","f","e","i"]
- for ja in stuName {
- if ja == input {
- return ""
- }
- }
- func result2(input2: String) -> String {
- let stuPercent = ["93%","75%","65%","58%","43%","Sorry you failed"]
- for la in stuPercent {
- if la == stuName[0] {
- return "Congratulations you! got \(stuPercent[0])"
- }
- }
- return "You can do better! Best of luck for ahead."
- }
- print("You are a registered member. Please press eneter again and type your name again.")
- let presEn: String = readLine()!
- print(result2(input2: presEn))
- return "Sorry! you're not registered"
- }
- print("Type your name")
- var myName: String = readLine()!
- print(result(input: myName))
Add Comment
Please, Sign In to add comment