TermNotes v.1.0.2
In this new version of the code, several changes have been made to handle invalid user inputs and provide appropriate error messages. Here are the changes:
In the deleteNote() function, a while loop is added to check if the user enters a valid note ID. If the input is not a number, the loop will continue to prompt the user for a valid ID until one is provided.
Similarly, in the deleteAllNotes() function, a while loop is added to validate the user's choice. The loop will continue until the user enters either 'Y' or 'N' to confirm the deletion.
The showNote() function and the notesMenu() function also include while loops to handle invalid note IDs and menu options, respectively. These loops will continue to prompt the user for valid input until provided.
Inside the notesMenu() and mainMenu() functions, while loops are added to validate the user's menu option choice. If the input is not a number, the loop will continue to prompt the user for a valid option until one is provided.
These changes ensure that the program handles incorrect user inputs gracefully, providing clear error messages and allowing the user to correct their input without exiting the program.