Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152
‘#mastery01’ Articles at TC101 Fall 2015
Introduction to Programming Python and C++

Tag Archives: #mastery01

#Mastery1 and #Mastery2 #TC1017

Link#Mastery01 and #Mastery02 #TC1017

Mastery 1,2: IDLE Graphic User Interface Python

Here is a post that explains how to create and tun a python file from the GUI of Python The first thing you have to do is to run the GUI of python; when the screen shows up, you can create a new project by … Continúa leyendo Mastery 1,2: IDLE Graphic User Interface Python

Here is Mastery #1 and Mastery #7. The first one was about…

Here is Mastery #1 and Mastery #7. The first one was about creating a C++ file, and the second one was about writing comments on C++. Both arre really easy. I decided too keep the voice with speed and the change of voice. Here is the video: https://www.youtube.com/watch?v=0eBR0vuEuo4

#Masteries 1 and 7

Mastery 1. Ability to create C++ file and run from command line… Mastery 7. Use of comments in C++…. And here my video:

#Masteries 1 and 7

Mastery 1. Ability to create C++ file and run from command line… Mastery 7. Use of comments in C++…. And here my video:

#Mastery01

Ability to create C++ file and run from command line

Mastery 1 and 10

To create your python file you have to open your text hackable editor (mine is Python) lets write a simple line of code to see if it works, i will use the function print to start print evaluates each expression in turn and writes the resulting object to standard output (see below). If an object […]

Mastery 1 & 7

Today I’m going to show you how to do two simple things on C++: create and run a programm and adding a comment to your program.

If you are on Windows, the first thing you need is a text editor where you can create your programs, and another program which works as a terminal, where you will run your programs. So, for the text editor, you can actually use Windows Note Pad, but the UI isn’t friendly at all and it may bore you; so instead, there’s this text editor called Atom which is a great tool with a nice UI. You will enjoy doing your programs on Atom. And the second thing you need is a terminal called Cygwin which will run your programs. You need to install certain things on Cygwin for its proper functionality. Here is a great video that will help you with a step by step installation.

Now that your programming environmet is set, you are ready to start this amazing journey.

When you install Atom, make sure to give it an easy access location within your computer, this will later be very important. Now, when you first open Atom, it looks like this:

This is where the magic starts.
For your first program, you will be able to print (show in the terminal [Cygwin]) a message. 
In C++ and for basic programs, you will have to write this first code:

This gives you the ability to write your program INSIDE the braces { }. Once you have this piece of code, you will want to save it as “NAMEOFYOURPROGRAM.cpp”. The “.cpp” is the most important thing, because it gives the text the characteristic of being a C++ file.

Now that you are done with this, you want to write the message you want the terminal to show when you run your program. So, in order to do it, you need your first command: 
– cout (its C++ way of saying “show this”).

The programm needs to be written in this way:

cout << “The text you want to show” << endl; 

Now you know how to write your very first basic C++ program! 
There’s this other thing called comments that you can add to your program but it won’t affect it. They are useful when you want to explain how you did something in that specific line.
To add a comment, you simply write // and your comment next to it. 

You are now done with your program!

What you want next is to run your program. This will be done on the terminal, Cygwin. 

When you open Cygwin, it kinda looks like any “hacking program” you’ve seen on a movie, which is pretty cool. 

Mastery 1 & 7

Now, you need to give the terminal the location of your program (that’s why I told you this step was important) and this is done with a command called “change directory” and is written as it follows:

This change of directory is specific for my computer, it will look different with your computer and will depend on where you saved your first program. 

Now that Cygwin knows where is the program you want to run, you need to tell it to compile it. This is done with the command: “g++ YOURPROGRAM.cpp”

This will compile your program. Now Cygwin is able to run your program, and is done with the command “./a.exe”. When you execute your program, Cygwin will do whatever you programmed on Atom. In this case, just some text.

And that’s pretty much it! You are now able to create a C++ file, run your program, and add comments to it. Congrats! 😀

Mastery 1: Create Python file and run from command line

Making a Python file is pretty easy. Open a new Atom sheet and save it as a .py file.

All right, now write your code.

now run it with the command line.

Easy as pie.

What should you work on?

Week #12 and more partial exams for you.

For this week's readings:
C++ (TC1017) should either be looking at support for your project, ImageMagick C++ libraries are a good start.
Python (TC1014) should be finishing chapter 11 (Dictionaries).