There are many computer languages just as there are many languages used by people. Many of the computer languages have similiar grammar. Computer programs are typically a sequence of sentences. The sentences are made up of words and punctuation.
The words and punctuation work together to allow the programmer to describe how the problem can be solved by the computer. There are several types of sentence in most computer languages and they typically distinguished by special keywords or punctuation.
This document is not about a specific programming language but about programming in general. So how do we solve problems using a computer? Here is a diagram that shows some of the common ideas.
To solve a problem, you need to have some understanding of what a computer can do. A computer manipulates data. The computer chip (CPU) has instructions that process numbers. There are two types of numbers that the CPU can process.
Computers are Logical. Logic is to do with things that are TRUE or FALSE. As mentioned above, a byte is made up of 8 bits. Each bit can be either 0 or 1. Often the value 0 is used to represent FALSE.
There are three main logical functions.
It is hard to explain how fast modern computers are. You may see that a computer has a 2.5 Gigahertz clock speed. If it takes 10 clock ticks to do an instruction then that is 250 million instructions per second. That is for a single CPU. Modern computers often have two or four CPUs (Cores). If you made a little robot and an instruction told it to move the width of a human hair, then doing that at 250 million times a second, the robot would move faster than the space shuttle entering the earths atmosphere at Mach 25.