Variables & Data Types

Your programs need to store data. I will show you how variables work, what types exist, and which one to pick for each situation.

57 lessons
225 min

Lessons

1. Intro

The Goal

4m

2. What is a Variable?

Containers for values

4m

3. Vocabulary - Data Types

What types exist

4m

4. The int Type

Storing integers

4m

5. int Range and Limits

What fits in int

4m

6. Quiz: Integer Basics

Integer types

2m1 problems

7. Overflow - What Happens

Going past limits

4m

8. Quiz: int Type

Test your understanding

3m1 problems

9. The long long Type

64-bit integers

4m

10. When to Use long long

Avoiding overflow bugs

4m

11. Quiz: Large integers

Large integers

3m1 problems

12. The LL Suffix

Marking large constants

4m

13. The double Type

Floating-point values

4m

14. Floating Point Precision

Not infinite precision

4m

15. Quiz: Integer type

Integer type

3m1 problems

16. Precision Errors in Practice

When rounding matters

4m

17. When to Use double

Decimals vs integers

4m

18. Quiz: Decimal numbers

Decimal numbers

3m1 problems

19. The char Type

Storing letters

4m

20. ASCII Values

The character encoding

4m

21. Character Arithmetic

Math with letters

4m

22. Challenge: Simple Addition

Add two numbers

5m1 problems

23. Quiz: char Type

Test your understanding

3m1 problems

24. The bool Type

Binary states

4m

25. Boolean in Conditions

Using bool with if

4m

26. The string Type

Storing words

4m

27. Basic String Operations

Working with text

4m

28. Challenge: Rectangle Area

Calculate with doubles

5m1 problems

29. Quiz: Text storage

Text storage

3m1 problems

30. Declaring Variables

How to create them

4m

31. Variable Naming Rules

Legal identifiers

4m

32. Quiz: Data storage

Data storage

3m1 problems

33. Variable Naming Conventions

Readable code

4m

34. Initialization vs Declaration

Starting values

4m

35. Quiz: Data storage

Data storage

3m1 problems

36. Uninitialized Variables

Random data

4m

37. Constants with const

Unchangeable variables

4m

38. Why Use Constants

Safer code

4m

39. Quiz: Data storage

Data storage

3m1 problems

40. Type Conversion - Implicit

Silent changes

4m

41. Type Conversion - Explicit

Forced changes

4m

42. Quiz: Data storage

Data storage

3m1 problems

43. Common Type Mistakes

Typical errors

4m

44. Printing Variables

Displaying values

4m

45. Printing Multiple Values

Combining text and data

4m

46. Quiz: Integer type

Integer type

3m1 problems

47. Problem - Calculate Rectangle Area

Practice with variables

4m1 problems

48. Problem - Convert Celsius to Fahrenheit

Practice with doubles

4m1 problems

49. Problem - Sum of Two

First real problem

4m1 problems

50. Sum of Two - The Idea

Main approach

5m

51. Sum of Two - Implementation

Working solution

6m1 problems

52. Lessons from Sum of Two

What we learned

4m

53. Problem - Temperature Convert

Celsius to Fahrenheit

4m1 problems

54. Temperature Convert - The Idea

Formula application

5m

55. Temperature Convert - Implementation

Working solution

7m1 problems

56. Lessons from Temperature Convert

What we learned

4m

57. Section Recap

What we learned

5m

Ready to start learning?

Access all 57 lessons with interactive content and progress tracking.