Fichas
Introduction to computer science
Fichas del conjunto (5)
- 1Variables - Identifiers (names) given to memory locations whose contents will change during the course of the programConstants - Name given to memory locations where the value will not change through the course of the program
- 2Data Types Integer - A whole number Real / Float - A number with a fractional part Character - A single letter, number, or special characterData Types
String - One or more letters, numbers, or special characters
Boolean - A variable which holds only a true or false value - 3Arithmetic operators + Addition - Subtraction * Multiplication / Division MOD Modulus (Remainder) DIV Quotient (Whole) ^ ExponentiationArithmetic operator examples
6+5 gives 11
6-5 gives 1
12*2 gives 24
12/2 gives 6
13MOD5 gives 3
13DIV5 gives 2 - 4Comparison operators == Equal to != Not equal to < Less than <= Less than or equal to > Greater than >= Greater than or equal toComparison examples
2==3 gives False
4!=4 gives False
2<5 gives True
2<=6 gives True
3>4 gives False
10>=10 gives True - 5Logical Operators AND - Both comparisons are true OR - At least one comparison is true NOT - Flips the result of the comparison XOR - Only one comparison is true (Exclusive OR)Logical operator examples
(23!=3) AND (2==3) gives False
(2==2) OR (2!=3) gives True
NOT (2==2) gives False
(1<=4) XOR (6>=1) gives False
Información
- Descripción
- Introduction to computer science
- Creado por
- Erikas Nakonecnikovas
- Visitas
- 14
- Valoración