Note: You must save your solution as
solution_part1.kt
for Part I, andsolution_part2.kt
for Part II to be submitted before 9AM.โ ๏ธ
fun main() {
println(mdChar("ali"))
}
Output:
The middle character in the string: 5
fun main() {
println(vowCount("supermarket"))
}
Output:
Number of Vowels in the string: 4
c. Write a function named isEven that accepts an int argument. The method should return true if the argument is even, or false otherwise.
fun main() {
println(isEven(2))
}
Output:
true
fun main() {
println("John Doe)
}
Output:
JohnDoe
isPalindrome("radar")
Output:
"radar" is a palindrome string.
Password rules: A password must have at least ten characters. A password consists of only letters and digits. A password must contain at least two digits.
validate("abcd1234")
Output:
Password is valid: abcd1234
roundOff(34.5458738f)
Output:
34.50