I have to create a program where you have 4 choices and it gives you different messages. I can't compile the program due to the error messages. I can't figure out what the problems are. I know I have done program functions before...so I don't understand the erros in the void part. Maybe I called the prototypes wrong?
Check lines 62, 149, and 167. There are statements there that won't ever execute.
Your errors, though, I'm guessing are coming from line 139. You have several errors there, one being that you forgot the modulus operator and how to use it. Research time! http://www.cplusplus.com/doc/tutorial/operators/
Just line 62? It looks the same as the other ones...(Sometimes it's hard to see the mistakes because I use a desktop computer monitor because the screen of my laptop doesn't work)
As for lines 149 and 167, I should be calling pause_m for the usdt_monitor file unless i should delete the return; parts?
Here's the entire pseudocode:
Function main
Pass In: nothing
Do
Call: clear_m
Display "Welcome to the Fun Program."
Display "Select from the menu."
Display a blank line.
Display "A gets Counting Loop."
Display "B gets Impossible."
Display "C gets Missing Item."
Display "D gets Odd or Even."
Display "E gets Poem."
Display a blank line.
Display "Q quits the program."
Display a blank line.
Display "Enter the letter of your choice.".
Display "Then hit the enter key.".
Display a blank line.
Display "Your choice: --> ".
Get the response for user_choice from the keyboard
Case of user_choice
'A' Call: counting_loop
'B' Call: impossible
'C' Call: missing_item
'D' Call: odd_even
'E' Call: poem
Endcase
While user_choice not equal to 'Q'
Pass Out: zero to the OS
Endfunction
********************
Function counting_loop
Pass In: nothing
For x starts at 0, x < 5, increment x
Display "Are we having fun?"
Endfor
Call: pause_m
Pass Out: nothing
Endfuction
********************
Function impossible
Pass In: nothing
Display "The repeat until loop is impossible in C++."
Call: pause_m
Pass Out: nothing
Endfuction
********************
Function missing_item
Pass In: nothing
Display "This program is missing only the while loop."
Call: pause_m
Pass Out: nothing
Endfuction
********************
Function odd_even
Pass In: nothing
Display a message asking user for an integer value
Get the user_integer from the keyboard
If user_integer modulus 2
Display "Your number was odd."
Else
Display "Your number was even."
Endif
Call: pause_m
Pass Out: nothing
Endfuction
********************
Function poem
Pass In: nothing
Display a 4 line poem
Call: pause_m
Pass Out: nothing
Endfuction
********************
clear_m
and
pause_m
are functions defined in the udst_monitor.h