mardi 29 août 2017

Using switch–case statements to verify user input

screenshot of the application

Currently, I am trying to test something but I am stuck. Now I do not have to use switchcase. I could use ifelse instead, but I just figured that switchcase statements are easier.

Anyway, I want to use either switchcase statements or ifelse statements to verify that the user only inputs numbers and then re-direct them somewhere depending on if the verification failed or passed. Now I have tested this. It works, but it like crashes when the user enters in anything other than only numbers. I would like to put the verification code under the comment /*Error message for if the user entered any non-numbers.*/ if possible. How would I accomplish this?

Aucun commentaire:

Enregistrer un commentaire