Chapter 1: Introduction - II

Lecture Goals

Translating Human-Readable Programs to Machine Code


Programming Languages

Specific and General Purpose Languages

The Evolution of C++

Compiling a Simple Program (hello.cpp)

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.

 



Errors (Syntax and Logic Errors)


The Compilation Process


Algorithms

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?