Assignment: Functions
char toUpper(char) – checks if a char is a lowercase alphabetic value. If it is, return the uppercase equivalent. If it isn’t, return the original char. Depends on no other functions.
string toUpper(string) – iterates over each character in the string and capitalizes it with the toUpper(char) function. Depends on the toUpper(char) function.
string fixNum(string) – returns a string with the following replacements made to the string argument:
Before: After:
O 0
I 1
E 3
S 5
aa 7
int c_to_i(char letter) – Checks if a char is numeric. If it is, return the integer equivalent. If it is not, return -1. Depends on no other functions.
double myPow(int, int) – Returns the first argument raised to the power of the second argument. (Be careful, this function should work for all positive and negative integers).
Comments
Leave a comment