Note: You must save your solution as
solution_part1.ktfor Part I, andsolution_part2.ktfor Part II to be submitted before 9AM.⚠️
fun main() {
println(mdChar("ali"))
}Output:
The middle character in the string: l
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