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

Tag Archives: #Mastery10

#Masteries 9 & 10

This is th video for masteries 9 and 10 Basic types and their use in C++ Basic output (printing) and input (text based) in C++ Here is the link  

#Masteries 9 & 10

This is th video for masteries 9 and 10 Basic types and their use in C++ Basic output (printing) and input (text based) in C++ Here is the link  

Masteries 9 & 10

Basic types and their use in Python.
Basic output (print) in Python

Masteries 9 & 10

Basic types and their use in Python.
Basic output (print) in Python

Masteries 7 & 10

Mastery 7 – Use of comments in Python You may understand your code perfectly just after you wrote it, but if someone else tries to know what you did or some years later you want to accurately remember what you had done, it can get tricky, but worry not! Comments are your saviour! On Python, comments’ syntaxis […]

Masteries 7 & 10

Mastery 7 – Use of comments in Python You may understand your code perfectly just after you wrote it, but if someone else tries to know what you did or some years later you want to accurately remember what you had done, it can get tricky, but worry not! Comments are your saviour! On Python, comments’ syntaxis […]

Mastery 10!

Here is video of mastery 10 😀

Hope it helps.

It’s about:

  1. Basic output (printing) and input (text based) in C++

 

Basic output (printing) and input (text based) in C++

A computer program can do two main things, ask for information or give the user new information. This two concepts are input and output, and it’s what we are going to talk about in this post. First, their definition: Output:… Continue Reading →

#Mastery10

Basic output (printing) and input (text based) in C++

Mastery 10

Today, I’m going to show you some basic input and output in C++.

On masteries 1 & 7 we learned some basic output, which is used as “cout”. cout is used when the program prints information you gave it to it in the program. When you want to input information from the terminal, while the program is running, you need a variable and the “cin” command. 

In order to do this, we will create a program that asks the user for two integer numbers, and then the program will add those numbers and then print the result.

So, you will need our “basic code” that we learned on masteries 1 & 7:

image

Now that we have our basic code, we will write the program inside the braces. 

The first thing we need to do, is to establish the variables we are going to use. We need two variables for the numbers the user is going to input in the program and another variable that will work as the result. 
The variables need to be established inside the braces, and are written as:
int FIRSTVARIABLE, SECOND, THIRD;

image

Now that we have our variables, we can tell the program what it needs to do. For that, we will simply do as follows:

  1.  Print (cout) a question where the program asks the user for the variables (cin) 
  2. Write a math operation with the variables 
  3. Print the result:
image

And that’s it. You can use this principle to perform other math operations:

image

Now, run your program in the terminal. Remember to change the directory, compile your program and then run it:

Mastery 10

You now know how to do a basic program with inputs and outputs, congrats! 😀

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