A program is a set of instructions a computer follows in order to perform a specific task. A programming language is a special language used to write computer programs.
What Is a Program?
Computers are designed to follow instructions. A computer program is a set of instructions that tells the computer how to solve a problem or perform a task.
Suppose we want the computer to calculate someone’s gross pay. Here is a list of steps the computer might do:
- Display a message on the screen asking “How many hours did you work?”
- Wait for the user to enter the number of hours worked. Once the user enters a number, store it in memory (Main Memory, i.e. RAM).
- Display a message on the screen asking “How much do you get paid per hour?”
- Wait for the user to enter an hourly pay rate. Once the user enters a number, store it
- Multiply the number of hours by the amount paid per hour, and store the result in
- Display a message on the screen that tells the amount of money earned. The message
must include the result of the calculation performed in step 5.
Collectively, these instructions are known as an algorithm. An algorithm is a set of well-defined steps for performing a task or solving a problem.
It is important that steps are sequentially ordered. Step 1 should be performed before step 2, and so forth. It is important that these instructions be performed in their proper sequence.
There are two categories of programming languages:
A low-level language is close to the level of the computer, which means it resembles the numeric machine language of the computer more than the natural language of humans.
The easiest languages for people to learn are high-level languages. They are called “high-level” because they are closer to the level of human-readability than computer-readability.
A lot of high-level languages have been created during the passage of time. C++ is a widely used programming language because, in addition to the high-level features necessary for writing applications, such as payroll systems and inventory programs, it also has many low-level features.
C is the mother language of C++, which focuses on writing operating systems and compilers programs. Since C++ is the mature version of C, it carries all of C’s low-level capabilities with it.
C++ is also popular because of its portability. You can write C++ program and run it on any platform/system. Some changes in the program or recompilation are required for successful execution on the required system.
Learn C++: Part 2 (coming soon)