Programming Basics!: Basic Terms!
Programming Basics!: Basic Terms!
!
!
Basic Terms!
Algorithm -
!
Flowchart -
!
Pseudo code -
!
Program - set of instructions that a computer follows
!
Low level - machine language. Written in 1s and 0s
!
High level - Allow powerful complex programs without knowing how the CPU works. Ex. C++,
Java, Python
!
compiler - program that translates high-level into separate machine language program
!
interpreter - translates and executes the instructions in a high-level language
!
keyword - specific meaning and purpose in programming language
!
library - collection to pre-written code for specific purposes
!
syntax - set of rules that must be strictly followed when writing a program!
!
Basic structure of C++ program:!
!
#include <iostream> directive!
using namespace std ; namespace!
Style: use of white space, variable names, constants, good function names, commenting, etc.!
Make code easier to read. Indents!
Understand the concept of debugging, what a syntax error is, what a logic error is!
Mistake that doesnt let code run such as typo, missing puntuation, incorrect operator!
Basic Input and Output!
cout - display multiple items with a single cout system!
!
<< operators!
endl - start a new line!
Escape sequences - !
!
\n newline \t tab \
!
placed at the end of strings!
!
cin - read input from keyboar!
!
short - 2 bytes!
int / long - 4 bytes!
float - 4 byte floating point number with 7 digits!
double - 8 byte floating point with 15 digits accuracy!
char - 1 byte for characters!
string - string of text!
bool - 1 byte for true or false!
!
Variable initialization - assign a value when declared!
!
local variables - declared inside a function. belongs only to the function in which it is declared!
!
scope - part of the program in which the variable can be accessed!
!