Programming Basics Flashcards
Binary
Machine code in 1s and 0s
Programming Languages
A middle man to translate computer machine code into a digestable language
Low-level vs. high-level programming languages
Low level: C, Assembly (closer to binary code)
High level: Java Python
IDE’s (Integrated Development Environments)
We use IDE’s to write code. A place to write, run, and debug code and also convert it to machine code (visual studio code. NetBeans, IntelliJ)
Syntax
All programming languages have a set of rules you must follow, at the forefront of those rules is grammar. Grammar in programming = syntax. In order to run smoothly, Syntax for each language must be correct.
Each language must be unique in its Syntax.
Print Statement
This is console.log, the output of the code
Modulus
Represented with % - allows us to get the remainder of a divisional operation
Done to see if the answer is even or odd
Strings
Another way to say text
Anything enclosed by quotation marks is a string
Concatenation
Adding strings together
Integer vs. String
4 in quotation marks (“4”) is treated as a STRING
4 without quotation marks (4) is treated as an INTEGER
Variable
Something that can store information and be referenced and manipulated.
Each variable has a type, name, and a piece of information stored inside of it.
One of the most important concepts in programming is variables. A variable points to a specific memory address that stores a value. Variables are given a name which can be used throughout your code to access that value.
Primitive Variables
Integers, Booleans, Floats, doubles, strings and Chars
Integer Variables
A variable that can store an Integer value,
Only whole values, it can and will not hold any decimal values
Boolean Variables
True or false
Used in conditional Statements
Float Variables
Can store up to 32 bits of information (in decimals)
Double Variables
Can store up to 64 bits of information (in decimals)