Wednesday, May 25, 2016

Programming: Module 2

The lab for module 2 introduced object types, performing math functions, use condition statements, and use methods.  Through the exercise, it was clear to see different types of objects are able to perform certain actions.  It was easy to see how math functions and condition statements in scripts.

Module 2 exercise was to use my full name and assign variables to get certain results. I named my name and split my first and last name.  I assigned the split name a new variable.  To print just my last name, I used listName[1].  Using the function len, with the split on my last name counted how many letters are in my last name.  After assigning the count of letters a variable, I used a math function to calculate 3 multiplied by the number of letters in my last name.  I then printed the last variable.

This screenshot shows the results of the script.  Each result is built on top of the other.  My full name is split, my last name is printed, then the number of letters in my last name, and finally number of letters times 3.

Script Results

No comments:

Post a Comment