Mastery 27

Hello people:

For mastery 27 I created a program that asks the user for different numbers and it checks that the user is actually introducing what the program is asking to. Take a look at the code:

 

In this program the user is asked to introduce and integer number, and if she/he introduce for example a number with decimals, the program does not accept the input and it keeps asking for an integer until the user introduces the correct number.

In the second part, the user is asked to introduce a number between an specific range, and the same thing hapens if the user introduces a number out if the range. 

Validating user input might be a bit complicated because the user can introduce whatever she/he wants, and sometimes an incorrect input might cause a program to explote.

 

CC BY 4.0 Mastery 27 by Jesús Tostado is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.