##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Your programs need to store data. I will show you how variables work, what types exist, and which one to pick for each situation.
The Goal
Containers for values
What types exist
Storing integers
What fits in int
Integer types
Going past limits
Test your understanding
64-bit integers
Avoiding overflow bugs
Large integers
Marking large constants
Floating-point values
Not infinite precision
Integer type
When rounding matters
Decimals vs integers
Decimal numbers
Storing letters
The character encoding
Math with letters
Add two numbers
Test your understanding
Binary states
Using bool with if
Storing words
Working with text
Calculate with doubles
Text storage
How to create them
Legal identifiers
Data storage
Readable code
Starting values
Data storage
Random data
Unchangeable variables
Safer code
Data storage
Silent changes
Forced changes
Data storage
Typical errors
Displaying values
Combining text and data
Integer type
Practice with variables
Practice with doubles
First real problem
Main approach
Working solution
What we learned
Celsius to Fahrenheit
Formula application
Working solution
What we learned
What we learned