Mapa mental
Programming Basics
Contenido del mapa
Programming Basics
Data Types
- programming languages Have Five Main Data Types
- Interger, int, Whole numbers only
- Real(float), real, Numbers that have a decimal place
- Boolean, bool, Can only take 2 values, usually TRUE or FALSE
- Character, char, A single letter, number or symbol
- String, STRING, Used to represent text, it is a collection of characters
- programming languages Have Five Main Data Types
Operators
- the Basic Arithmetic Operators are straightforward
- the arithmetic operators take two values and perform a maths function on them
- Addition, subtraction, multiplication and divison operators do what you'd expect
- The exponentiation operator is used to raise a number to a power
- The DIV operator returns the whole number part of a division and the MOD operator gives a remainder
- Assignment and Comparison Operators
- The assignment operator, =, is used to assign values to constants or variables
- A common mistake is to get the assignment operator = and the comparison operator == mixed up --- you'll know you've used them incorrectly because your code won't behave as intended
- the Basic Arithmetic Operators are straightforward
Constants and Variables
- Data Values can be Constant or Vairables
- Data values can be stored as constants or variables
- The name of the constant or variable is linked to a memory location that stores the data value. The size of the momory location depends on the data type
- A constant is assigned a data value at design time that can't be changed. If you attempt to change the value of a constant in a program then the interpreter or complier will return an error
- Variables in the other hand can change value which them far more useful than constants
- Constants and variables often need to be declared (at the stat of the program) before you can use them.
- Data Values can be Constant or Vairables
Strings
- Strings are written inside Quotation marks
- Strings are usually written inside double quotation marks ", but sometimes singles quotes are used '
- Strings can be joined together ---- to form new strings ---- this is called concatenation. it's often done using the + opeator
- Programs let you Manipulate Strings in a variety of ways
- Before getting started on string manipulation you should know that the characters are usually numbered starting at 0
- common string manipulation functions needed for the exam are: x.upper-changes all strings in x to upper case, x.lower-changes all characters in string x to lower case, x{i}-extracts the character in position i from string x and x.sunstring(a, b)-extrqcts a string starting at position a with length b from string x
- Strings are written inside Quotation marks
Program flow
Información
- Descripción
- Mapa Mental sobre Programming Basics, creado por Dylan Fallon el 06/06/2019.
- Creado por
- Dylan Fallon
- Visitas
- 0
- Valoración