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 4
Introduction to Programming Python and C++

Tag Archives: #Mastery10

Basic Output


     Output is defined as what the program gives away as a result. This is a text that will be displayed in your screen during the running of your program. For printing your output on Python 3 we use:


print( )


     Inside the parenthesis is where you type the text that you would like to be displayed. This can be a string, a variable, or both.


      To print a string, which is an extract of text typed by the programmer, it is necessary to place it between quotation marks. Otherwise, you will receive a message saying you have a Syntax Error. In this example, the text displayed in the screen will be: Hello World!


print(“Hello World!”)


       For printing a variable, you need to place the name of the variable between the parentheses without using any quotation marks. Otherwise, you will be printing text. Also, you can create some mathematical operations between the parenthesis and the output will be the result of those operations. For example, the text displayed in the screen when running this program will be: 12


X = 5

Y = 7

Print(x+y)


      You can also print string variables by the same method


       For printing plain text and the value of a variable. It is necessary to place the text between quotation marks. The text and the variable need to be separated by a comma. For example, the following program will print: Hi, Laura!


Name= Laura

Print(“Hi,”, name, “!”)

      This other program will print: The sum of 5 + 7 equals to 12


X=5

Y=7

Print(“The sum of”, x, “+”, y, “equals to”, (x+y))

#MASTERY10

Basic output (print) in Python

#MASTERY10

Basic output (print) in Python

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

Hey there this is which is about output (printing) and input (text based) in C++. So let´s get started!

 

First what you want to know is that there are a few ways in which you can print something in your programs.

 

For outputting there is:

 

cout

std output stream

cerr

Std error (output) stream

clog

std logging (output) stream

 

This basically work the same all of them they just differ on their purpose. Cerr and clog are already predetermined to work as as error or logging strings or values.

 

The following actions would…

 (Not using the greater than symbols because the blog erases the content)

Cout xendl; – Print the value of x.

 

Cout 20 endl; – Print the number 20.

 

Cout “Hello” endl; – Print the string Hello.

 

The (less than symbol) operator inserts the data that follows it into the stream

 

 

cin

standard input stream

 

 

96

Normal
0

21

false
false
false

ES-TRAD
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Tabla normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:””;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:Calibri;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-fareast-language:EN-US;}

Cin, Lets the users to input some text (string) or actual value into the program. Is the way to introduce information to the coding and let it interact.

 

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

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 10: Basic output

To print something in python you just write print and what ever you want the terminal to print in parenthesis.
Like this:

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

So for this mastery basically what I did was take the wsq about basic operations (sum, dif, prodcut and division) and rewrite the code to explain it, which is to make a program to print some indication for the user and then the user can insert any text related to the indication by the computer. … Continue reading Mastery 10: Basic output (printing) and input (text based) in C++

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

So for this mastery basically what I did was take the wsq about basic operations (sum, dif, prodcut and division) and rewrite the code to explain it, which is to make a program to print some indication for the user and then the user can insert any text related to the indication by the computer. … Continue reading Mastery 10: Basic output (printing) and input (text based) in C++

Input and output, the basics: Masteries 10, 28

One of the basic things every one who learns programming do is to say Hello to hte world, and to make the user say hello to the world; in python 3 terms, it would be the print command, and the input command. So really really … Continúa leyendo Input and output, the basics: Masteries 10, 28

Input and output, the basics: Masteries 10, 28

One of the basic things every one who learns programming do is to say Hello to hte world, and to make the user say hello to the world; in python 3 terms, it would be the print command, and the… Continue Reading →

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