Intro Flashcards
What is an IDE (Integrated Development Enviorment)
A place to write, run, and debug code and convert it into machine code.
NetBeans, IntelliJ, Visual Studios.
What is Syntax
A set of rules you must follow when writing code in a language
It’s similar to grammar rules in real life languages
What is a Console
A text interface in a computer that can be used for a variety of purposes
Main use is for outputting text from the program using code.
Print statement
Prints text to the console for programmers to see
Print (“Hello World”)- python
Modulus
Represented with %
Allows us to get the remainder of a division problem. The console will oly show the remainder
Print(10 % 3)
Console: 1
What is a string
Anything enclosed by quotation marks is a string
“Hello World”
“A”
Concatenation
Adding two strings together
print( “Game over, “ + 4 + “ was your final score.”)
The 4 “4” Dilema
The 4 in quotation marks is a string
The 4 without quotation marks is an integer
What is a variable
Something that can store information
Can be referenced and manipulated
Think of it as a cardboard box
Each variable has a type, name, and a peice of information
Name is just a name for the variable
Integer
A variable that can store an integer value
Cannot hold decimal values
-2,147,483,648 to 2,147,483,648
Booleans
Can store a value of either true or false
Can only hold true or false
Float and double variables
Both can store numbers with decimal places
Float: can store up to 32 bits of info
Double: can store up to 64 bits of info
String variables
Just like strings, but can be stored in a variable
Used for displaying text and storing input information, outputting information in a readable format for the user
Char variables
Can only hold one character
“A”
Useful for reading one button press of one character in a string without a string variable. Like a game controlled by a keyboard
The use of variables
To keep track of things in code, such as a user’s name and score to reference and modify.
Naming variable big rule
They must be one continuous string
camelCase
The writing of code that doesn’t capitalize the first letter but capitalizing all words after. Makes it easier to read
camelCaseVariable
The if statement
The most basic conditional statement
If something is true, do one thing
If something isn’t true, do another thing
If (Thing is True) {do what ever is in here}