Worksheet On Functions
Worksheet On Functions
Receives a character and returns true if the parameter is a vowel and false
otherwise.
2.Create a class called myMath which has the following functions in it.
Receives an integer n, adds up the digits of the integer and returns the sum
Page 1 of 3
3.Create a class myString that has the following public static member
functions.
Receives a String and checks whether it contains only digits and returns
true; otherwise it returns false.
Receives a String, counts the number of words and returns the same.
Receives a String, counts the number of vowels and returns the same.
Receives a String, removes the extra spaces between the words in the
String and returns the String
Page 2 of 3
Page 3 of 3