Computer is
Programmable machine designed to follow instructions
Program is
Instructions in computer memory to make it do something
Programmer is
Person who writes instructions to make computer perform a task
Main Hardware Components Categories:
Central Processing Unit (CPU), Main and Secondary Memory, Input and Output Devices
Cental Processing Unit is
Brain part, controls each process and communicates to the components to execute instructions
Random Access Memory (RAM) is
Main Memory/Computer hardware that can be read and changed in any order, typically used to store working data and machine code
Motherboard is
Main circuit board that holds each part of the computer and connect it to each other
Main Memory is
Fast memory that will be erased when the program terminates or computer turns off
Main Memory Address is
Main Memory organized with bits (byte = 8 bit). Bytes have addresses. Each byte in memory identified by a unique number known as address
Compiler is
Translater that translates high-level source code (human understandable) into low-level object code (computer understandable)
Secondary Memory is
Permanent memory that saves your data in PC
Input devices are
Devices that send information to the computer from the outside
Output devices are
Devices that receive information from the computer to the user
Types of programming languages:
Low-level, Middle-level, High-level
Low-level languages are
Can be understood by the machine only. Very hard to learn by human. Machine Architecture depending languages (Assembly)
Middle-level languages are
Staks in between high and low levels languages (C, Pascal)
High-level languages are
Can be understood by human only. Easy to learn by human. Not Machine Architecture depending languages (C++, Java, Python, C#)
Categories of software:
System software - programs that manage the computer hardware (operating systems, software development tools)
Application software - programs that provide services to the user (games, word processing)
Binary numbers are
Machine language instructions (10100..)
Syntax is
The rules of grammar that must be followed when writing a program
Punctuation is
Characters that mark the end of a statement
Operators are
Arithmetic operations to work with (add, substract, decimal, multiply, ..)
Key words are
Reserved words that can’t be used for any other purposes (int, return, namespace, ..)
Variables are
Named links to the memory for holding data. Must be defined before it can be used
Procedural programming -
Solves the problem from the top of the code down to the bottom (C, Pascal)
Object-Oriented programming
Uses classes and objects (calls methods to do something) (Java, C++, Python)
Algorithm is
Formula that used for solving a problem
Identifier is
Programmer-defined name for some part of a program (variables, functions, ..)
Literal is
A value that is written into a program’s code (12, “hello”, 3.5)
Return 0; is
Statement that used to exit the main function. Returning 0 typically indicates that the program has executed successfully
cout
« ““ « endl; Outputs the result
cin
» variable; Used to take input from the user
Rules of naming identifiers in C++
1) Must start with a letter or an underscore
2) Can contain letter, digits and underscores after the first character
3) Case-sensitive (age, Age and aGe are different)
4) Can’t reserve keywords (int, return, ..)
5) Avoid starting with an underscore followed by an uppercase letter (reserved for implementation, _Age)