These are two questions from my book I just can't figure out.
Write the code for:
1. a function that recieves an integer passed to it, function named halveNumber(), should divide the integer by 2, the return the result(which could be a decimal place)
2. a function that prompts the user to enter a character, stores the user's response in char variable, should return character entered by the user, name of function is getChar().
I am just not understanding how to write these and the Prof isn't help at all.
Write the code for:
1. a function that recieves an integer passed to it, function named halveNumber(), should divide the integer by 2, the return the result(which could be a decimal place)
2. a function that prompts the user to enter a character, stores the user's response in char variable, should return character entered by the user, name of function is getChar().
I am just not understanding how to write these and the Prof isn't help at all.
Comment