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
‘#Mastery07’ Articles at TC101 Fall 2015, Page 2
Introduction to Programming Python and C++

Tag Archives: #Mastery07

Masteries 6 & 7

Mastery 06 – Install Linux on their own computer Mastery 07 – Use of comments in Python I included Mastery 05 – Demonstrate use of Linux sufficient for exams/quizzes on this video.

Masteries 6 & 7

Mastery 06 – Install Linux on their own computer Mastery 07 – Use of comments in Python I included Mastery 05 – Demonstrate use of Linux sufficient for exams/quizzes on this video.

Mastery 7

This is so easy that I am ashamed that i just learned this 5 minutes ago. So, comments in python are a way for the programmmer to communicate with any other observer inside the code but without affecting the code To do this you must write #and then, whatever you want to say. As you […]

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! 😀

#MASTERY07

Use of comments in Python

Mastery Number #7

Comments in Python, a really simple thing, i actually learned something new while researching, i didn’t know you could do a Multiple Line Comment, interesting…

Mastery Number #7

Comments in Python, a really simple thing, i actually learned something new while researching, i didn’t know you could do a Multiple Line Comment, interesting…

Use of comments in C++

Un comment es texto que puedes agregar en medio del programa, este se utiliza para explicar lo que hace el programa, ya que no afecta al texto que compone el código. Se debe escribir con // al inicio para indicar… Continue Reading →

#Mastery07 – Use of comments in C++

Hi! This is about how to use comments in c++. When you are typing a code and you are not the only one who is using it, its important to make comments on it. This helps the user to understand easier what each line is for. Comments can be used to transmit any type of message without interfering with the code at all.

 

How do you make a comment in a c++ code?

In the moment you type “//” the system recognizes this as a comment section and “ignores” what is after it when compiling.

WATCH MY VIDEO https://youtu.be/F_7Y8yXBmDQ

MASTERY 07: Basic types and their use in C++

(The credit of the background image goes to https://flic.kr/p/aq7Voo) For this mastery, I’m going to tell you all about the basic types and their use in C++. To begin with, a type is a set of values and here you can see which ones are the most important: -Int: The basic integer type. -Floating point: Float, […]

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).