Please do in C
Posted: Fri May 20, 2022 12:47 pm
Please do in C
Define a function hitOrstand that takes no argument. It should have the user enter a word. If the word starts with 'h' (upper or lower case), return 'h'. If the word starts with 's' (upper or lower case), return 's'. Otherwise it should ask again until an acceptable response is entered. Note: the user shouldn't be told what to enter. Of course, for a "real" program you'd want to actually print a prompt. We can assume the auto-grader knows.
Define a function hitOrstand that takes no argument. It should have the user enter a word. If the word starts with 'h' (upper or lower case), return 'h'. If the word starts with 's' (upper or lower case), return 's'. Otherwise it should ask again until an acceptable response is entered. Note: the user shouldn't be told what to enter. Of course, for a "real" program you'd want to actually print a prompt. We can assume the auto-grader knows.