Session 1: What is Programming?
Your Name
- 4 minutes read - 835 wordsSession 1: What is Programming?
Learn what programming really is, set up your development environment, and write your first C++ program.
🎯 Key Skills You'll Learn:
- Basic program structure
- cout for output
- Compiling and running programs
🚀 Session Project:
ASCII Art Name Generator
Learning Objectives
- Understand what programming is and how it relates to block coding
- Learn the basic structure of a C++ program
- Write and run your first C++ program
Warm-up (10 minutes)
Think about your experience with block coding:
- What did you create with blocks?
- How did you tell the computer what to do?
- What happened when you “ran” your block program?
New Concept Introduction (30 minutes)
What is Programming?
Programming is giving instructions to a computer, just like you did with blocks. But instead of dragging visual blocks, we type text commands that the computer can understand.
Block Coding vs Text Coding:
- Block coding: Drag and drop visual elements
- Text coding: Type specific commands in a programming language
Why C++?
C++ is a powerful language used to create:
- Video games (like Minecraft’s core engine)
- Operating systems (Windows, parts of macOS)
- Web browsers (Chrome, Firefox)
- Apps and software you use daily
Anatomy of a C++ Program
Every C++ program has this basic structure:
|
|
Let’s break this down:
#include <iostream>: Tells the computer we want to use input/output operationsusing namespace std: Lets us use standard C++ features without typing “std::” every timeint main(): This is where our program starts runningcout <<: Prints text to the screenreturn 0: Tells the computer the program finished successfully
Setting Up Your Development Environment
Recommended Setup: VSCode with MinGW (Best for Learning C++)
We recommend using Visual Studio Code with the MinGW-w64 compiler for the best C++ learning experience. This setup gives you:
- Professional development environment used by real programmers
- Excellent debugging and code completion features
- Integrated terminal for running your programs
- Extensions specifically designed for C++ learning
Quick Setup Steps:
- Follow the complete setup guide: VSCode C++ Configuration with MinGW
- Install Visual Studio Code
- Install MinGW-w64 compiler
- Install the C/C++ extension for VSCode
- Configure your development environment
Alternative Options (if you prefer something simpler to start):
- Online: Replit.com - No installation needed, works in your browser
- Desktop Alternative: Code::Blocks - Simpler IDE with built-in compiler
Why VSCode + MinGW?
- Industry-standard tools that professional developers use
- Excellent error messages that help you learn
- Powerful debugging features to understand how your code works
- Free and works on Windows, Mac, and Linux
- Extensive C++ learning resources and extensions
Hands-on Practice (40 minutes)
Exercise 1: Your First Program (15 minutes)
Type this program exactly as shown:
|
|
Run it and see what happens!
Exercise 2: Personalize It (10 minutes)
Modify the program to print your name:
|
|
Exercise 3: Multiple Lines (15 minutes)
Create a program that prints your favorite things:
|
|
Challenge/Quiz (10 minutes)
Challenge: ASCII Art Name Create a program that prints your name in large letters using ASCII characters. For example, if your name is “Sam”:
SSS AAA M M
S A A MM MM
SSS AAAAA M M M
S A A M M
SSSS A A M M
Validation Prompt
🤖 AI Validation Prompt
Copy this prompt and your code to ChatGPT or Claude for instant feedback:
```
I'm learning C++ and just completed Session 1. Here's my solution to the ASCII Art Name challenge:
[PASTE YOUR CODE HERE]
The challenge was: Create a program that prints your name in large letters using ASCII characters.
Please check if my solution:
1. Compiles correctly
2. Produces ASCII art output
3. Uses cout and endl appropriately
4. Has the basic C++ program structure
If there are issues, please explain what's wrong and give me a hint to fix it (don't give me the complete solution).
```
What You Learned
- ✅ Basic C++ program structure
- ✅ How to use cout to display text
- ✅ The difference between block and text coding
- ✅ How to compile and run a C++ program
Next Session Preview
In Session 2, you’ll learn how to get input from users using cin, making your programs interactive!