Tag Archives: mastery27

#TC1017 #mastery27: Validating user input

Hey! I created another PDF tutorial showing how to stop users from messing around with your programs by entering values that don’t correspond to the instructions. Hope you like it!

https://drive.google.com/open?id=0B7w3BFfqL9oQVFBubjJYRVBJbDA&authuser=0

Validating user input in C++ Mastery 27

Here is the link to my video tutorial on Validating User input in C++:

https://www.youtube.com/watch?v=uRbATMwf4yE

Mastery27


Mastery27

Mastery27

Validated user input in C++

#Mastery27

When you validate inputs, you allow that the program works better because all the things that the user writes will be evaluated before to executed a part of code.

In this picture you can see some examples of validating input, one of them validates a “char” and the other an “int”.

Is useful to know that in this example I used “DO-WHILE” to validate the input but you can validate inputs using “FOR”, “WHILE”, “IF”and more…

In the following picture you will see the program working, and you can realize that validating input is really useful to avoid that your program has bugs.

In this link you will find a pp that I did to explain validating input with more detail: https://drive.google.com/file/d/0B-NM4ghaDXBvZzRXNlpqR0I1UXM/view?usp=sharing

And here you will find my C++ code: https://drive.google.com/file/d/0B-NM4ghaDXBvTnNITkxPVXRwRzQ/view?usp=sharing

Finally, in this link I found information that helped me to uderstand the logic for this process: http://stackoverflow.com/questions/2075898/good-input-validation-loop-using-cin-c

Learn To Program 2015-04-06 19:56:00

Mastery27

El uso de diccionarios en Python es bastante importante, es por ello que a través de este Mastery, he realizado un programa con las características principales de éstos.
Para comprender su funcionamiento, utilicé las siguientes páginas:
http://www.python-course.eu/python3_dictionaries.php
https://docs.python.org/3/tutorial/datastructures.html

*******
Mi video:
*******
https://www.youtube.com/watch?v=aNoPiyOPQP8
**********************
Programa hecho en Python:
**********************
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery27.py

Learn To Program 2015-04-06 19:56:00

Mastery27

El uso de diccionarios en Python es bastante importante, es por ello que a través de este Mastery, he realizado un programa con las características principales de éstos.
Para comprender su funcionamiento, utilicé las siguientes páginas:
http://www.python-course.eu/python3_dictionaries.php
https://docs.python.org/3/tutorial/datastructures.html

*******
Mi video:
*******
https://www.youtube.com/watch?v=aNoPiyOPQP8
**********************
Programa hecho en Python:
**********************
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery27.py

Learn To Program 2015-04-06 19:56:00

Mastery27

El uso de diccionarios en Python es bastante importante, es por ello que a través de este Mastery, he realizado un programa con las características principales de éstos.
Para comprender su funcionamiento, utilicé las siguientes páginas:
http://www.python-course.eu/python3_dictionaries.php
https://docs.python.org/3/tutorial/datastructures.html

*******
Mi video:
*******
https://www.youtube.com/watch?v=aNoPiyOPQP8
**********************
Programa hecho en Python:
**********************
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery27.py

#mastery27

Hi classmates and proffessor, I have already finished my mastery number 27, where you have to valited if the data that the user enter is the data that you need or if it is not, this can be very useful becasue in this way you can be sure you will recive the correct information, I will leave my code below:

 

Code:

https://www.dropbox.com/s/986tr7jnu4zv5eu/mastery27.cpp?dl=0

Creation and use of dictionaries in Python

A dictionary is another type of container in Python, like lists and tuples, but this one has elements in pairs, these are called items, each key is separated from it’s value by a colon, each item is separated by commas and the dictionary is enclosed with {}.

To update a specific item in the dictionary, you type the name of the dictionary, after that the name of the item inside brackets and (”), then equaling this to the value you want to update it to.

The same goes for adding another item to the list, follows the same process and syntaxes.

Finally, to print the dictionary you just put it after the print function with parenthesis. In case you want to print only a specific item you need to type the name of the dictionary then the item you want to print, of course in this form [‘item’], and the whole thing goes between parenthesis as well.

Here’s an example:

Creation and use of dictionaries in Python

Creation and use of dictionaries in Python