Programming Fundamentals
Programming Fundamentals
Low-level programming
languages
Assembly or C
• High-Level programming
languages
Java or Python
Lower the level ->
More similar
to machine code
Syntax - Rules you must follow if you want your program to run
correctly
◦ How you type out certain functions
◦ What you put at the end of each line of code
◦ How you set up certain functions
◦ Syntax for each programming languages is unique
Breaking programming rules will result in an error
Variables
Something that can store information
Variables type
Integers, booleans, floats, doubles, Strings, and Chars
◦ Integer'sA variable that can store andInteger value■
⁃ 2,147,483,648 to 2,147,483, 648
CAN'T and WILL NOT hold any decimal values
◦ There is one big rule when naming variables They MUST be one
continuous String
Most programmers name variables according to camelCase Don't
capitalize the first word, but capitalize the first letter of all words
after it
Ex: anotherCamelCaseVariable
Conditional statement
The most basic conditional statement is the If Statement
If something is True do this, otherwise do something else
if (Thing is True) {
Do What's inside the curly braces
}
Whatever is inside the braces will be evaluated as either true or
false
if (Thing is false) {
Skip what's inside the curly
}
Eg:
if(score > 5) {
print ( "Nice Score!" )
}
The Else-if statement will only be evaluated if the preceding if (or if-
else) statement was bypassed due to it being false.
Check more info and example for switch statement
THATs WHERE ARRAY COMES IN it can store a lot of info
You will have an error
Allows us to repeat parts of code multiple times