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

Tag Archives: MASTERY9

Masteries 9 & 10

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

Basic Types and their use in C++

The types are defined as a set of values in C++. They can have different proposes in a program, and that is why they are classified in this order: Character types: They can represent a single character, such as ‘A’… Continue Reading →

Mastery 9: Basic types and their use in C++

Ok so… for these mastery I did some research .. because I didnt knew what a “basic type” was in c++… so here is what i found: Fundamental data types are basic types implemented directly by the language that represent the basic storage units supported natively by most systems. They can mainly be classified into:… More Mastery 9: Basic types and their use in C++

Types and uses #Mastery9

There are several types of data used in a code, all with different characteristics, uses and parameters. The main basic types are: characters, integers, floating points and boolean. In order to determine the type of data, one must first declare a variable which is done by writting:

Type NameofVariable;

Type would be:

Character: Characters are any symbol such as letters or numbers. They are declared by writting char and at they aren’t recommended to be used in operations since they only represent a character. They are useful if you wish to input a symbol. In case you want to input a message or code you could use a string in which case you would need to include the library string. 

Integer: Any number without decimals. They are declared by writting the type int and are useful for mathematical operations and determining conditionals. In case a value with a decimal is declared as an int, the program will turn it to the lower bound, for instance 1.999 would be 1. 

Floating Point: A floating point is any number, including decimals. They are declared by writting float or in case of a bigger number double. They are useful in cases which require precision with numbers such as the area of a circle or a logarithm. 

Boolean: Might only hold a value of 1 or 0. It’s declared by writting bool before the name of the variable. They are useful in conditionals, to determine wether an action should be done or not by acting as a true or false statement. 

Here’s an example of the types in a code:

 

I did a research and found this page which explains the types and their parameters: http://www.cplusplus.com/doc/tutorial/variables/

Thanks for watching!

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