Chapter 1: Introduction

Chapter Goals

What is a Computer?

What is Programming?

The Anatomy of a Computer (CPU, Memory, and bus)

The Anatomy of a Computer (Motherboard, Peripherals, and Networks)

The Anatomy of a Computer (Schematic)

Translating Human-Readable Programs to Machine Code (Machine Instructions)

Translating Human-Readable Programs to Machine Code (Assembler)

Translating Human-Readable Programs to Machine Code (Higher-level Languages)

Programming Languages

Programming Language Design and Evolution (Specific and General Purpose Languages)

Programming Language Design and Evolution (Incremental Growth)

Programming Language Design and Evolution (Planned Languages)

Becoming Familiar with Your Computer

Compiling a Simple Program ("Hello, World!")

Compiling a Simple Program

Compiling a Simple Program (Syntax)

Syntax 1.1 : Simple Program

header files
using namespace std;
int main()
{
   statements
   return 0;
}
Example:
#include <iostream>
using namespace std;
int main()
{
   cout << "Hello, World!\n";
   return 0;
}
Purpose: A simple program, with all program instructions in a main function.

 

Compiling a Simple Program

Errors (Syntax and Logic Errors)

Errors

The Compilation Process (Diagram)

The Compilation Process (Definitions)

The Compilation Process (Edit - Compile - Debug Loop)

Algorithms

Algorithms (Example)

You put $10,000 into a bank account that earns 5% interest per year. How many years does it take for the account balance to be double the original?