Let us say, you are an obedient student in a certain university. Your teacher instructs you to get the test papers inside her room. What will you do first? What will you do next? The answers to the following questions are what we so called PROGRAMS.
A program is simply a collection of a step-by-step instructions given to the computer to perform.
So in the example stated:
The first thing you will do is ....
1.) Stand up
2.) Say the word "Yes madame"
3.) Open the door
4.) Close the door
5.) Go to her room
6.) Open the door
7.) Get the test papers
8.) Close the door
9.) Go back to your classroom
10.) Give the papers to your teacher
11.) Sit down
Numbers 1 - 11 are all instructions. If you try to PROGRAM that in the computer, it will perform its task and will give its output.
HOW TO WRITE A PROGRAM?
Skeleton Formation (Pseudocode):
IF eat at 7:00 in the morning. THEN
YOU WILL NOT GET LATE IN CLASS
ELSE
YOU WILL GET LATE IN CLASS
END IF
Most beginners in Programming always starts with a skeleton formation. The purpose of the Pseudocode is to see the actual flow of the program that you will be creating.
How I Program in C++
#include
main()
{
int time;
cout<<"What time did you eat?";
cin>>time;
If(time == 7)
{
cout<<"You will not get late in class";
}
else
{
cout<<"You will get late in class";
}
}