Before doing coding for the programs we must know about tools used in programming. Following are the programming design tools that may help you to understand the logic and the way the programs are made.
Algorithm
An algorithm is a step by step solution of a problem. A machine cannot solve any problem its own. It needs instruction to perform. The well mannered and finite number of steps helps any machine to solve the problem. For example a robot needs instructions to polish a shoe or make a cup of tea.
Features
An algorithm to make a cup of tea
Step 1 : Start
Step 2 : Pour two glass of water in boiling pot
Step 3 : Lit the gas stove
Step 4 : Boil the poured water for about 3 minutes
Step 5 : Mix two spoon of tea leaves, three spoon of sugar and now add a cup of milk in it
Step 6 : Let it be boil for next 2 minutes
Step 7 : Off the stove
Step 8 : Pour the ready tea in three cup
Step 9: Give it to drinkers
Step 10 : Stop
An algorithm to find the sum of two unknown inputted numbers
Step 1 : Start
Step 2 : Input two numbers in a and b
Step 3 : add a and b and put it into c
Step 4 : Display c
Step 5 : Stop
An algorithm to find the greater number among any two unknown inputted numbers
Step 1 : Start
Step 2 : Input two numbers and store it in a and b
Step 3 : If a>b then
print a is the greater number
else
print b is the greater number
Step 4 : Stop
An algorithm to find the greatest number among any three inputted numbers
Step 1: Start
Step 2: Input any three numbers in a, b, c
Step 3: If a>b and a>c then
Print a is the greatest numbers
Elseif b>c theen
print b is the greatest
else
print c is the greatest
Step 4 : Stop
An algorithm to print first ten natural numbers
Step 1: Start
Step 2: Assign n=1
Step 3: Print n
Step 4: If n<10
Goto step 5
else
Goto step 7
Step 5: n=n+1
Step 6: Goto step 3
Step 7: Stop
An algorithm to find the sum of first ten natural numbers
Step 1: Start
Step 2: Assign n=1,s=0
Step 3: If n<10
s=s+1
Step 4: n=n+1
Step 5: Goto step 3
Step 6: Print Sum=; s
Step 7: Stop
Flowchart
Flowchart is a pictorial wise solution of any problem. Developers find it easy to study the steps using the picture. Since picture is more effective than words, flowchart is preferred by many. There are some symbols representation for the steps used to draw flowchart. They are:
1. Oval Shape
This shape is used to represent start and end of the steps.
2. Parallelogram
This shape is used to represent input as well as output of the program
3. Arrow/Lines
This shape is used to represent the flow of the program steps
4. Rectangle
Rectangle shape is used to represent process of the program
5. Assigning box
The predefined constant is represented by this shape
6. Circle
The Perfect circle is used to connect different flow of the program.
Flowchart for finding sum of two given numbers
Rules of Flowchart
- Algorithm
- Flowchart
- Pseudocode
Algorithm
An algorithm is a step by step solution of a problem. A machine cannot solve any problem its own. It needs instruction to perform. The well mannered and finite number of steps helps any machine to solve the problem. For example a robot needs instructions to polish a shoe or make a cup of tea.
Features
- There must be finite number of steps
- Input and Output should be predefined
- Steps should be well formatted. It must be clearly readout
An algorithm to make a cup of tea
Step 1 : Start
Step 2 : Pour two glass of water in boiling pot
Step 3 : Lit the gas stove
Step 4 : Boil the poured water for about 3 minutes
Step 5 : Mix two spoon of tea leaves, three spoon of sugar and now add a cup of milk in it
Step 6 : Let it be boil for next 2 minutes
Step 7 : Off the stove
Step 8 : Pour the ready tea in three cup
Step 9: Give it to drinkers
Step 10 : Stop
An algorithm to find the sum of two unknown inputted numbers
Step 1 : Start
Step 2 : Input two numbers in a and b
Step 3 : add a and b and put it into c
Step 4 : Display c
Step 5 : Stop
An algorithm to find the greater number among any two unknown inputted numbers
Step 1 : Start
Step 2 : Input two numbers and store it in a and b
Step 3 : If a>b then
print a is the greater number
else
print b is the greater number
Step 4 : Stop
An algorithm to find the greatest number among any three inputted numbers
Step 1: Start
Step 2: Input any three numbers in a, b, c
Step 3: If a>b and a>c then
Print a is the greatest numbers
Elseif b>c theen
print b is the greatest
else
print c is the greatest
Step 4 : Stop
An algorithm to print first ten natural numbers
Step 1: Start
Step 2: Assign n=1
Step 3: Print n
Step 4: If n<10
Goto step 5
else
Goto step 7
Step 5: n=n+1
Step 6: Goto step 3
Step 7: Stop
An algorithm to find the sum of first ten natural numbers
Step 1: Start
Step 2: Assign n=1,s=0
Step 3: If n<10
s=s+1
Step 4: n=n+1
Step 5: Goto step 3
Step 6: Print Sum=; s
Step 7: Stop
Flowchart
Flowchart is a pictorial wise solution of any problem. Developers find it easy to study the steps using the picture. Since picture is more effective than words, flowchart is preferred by many. There are some symbols representation for the steps used to draw flowchart. They are:
1. Oval Shape
This shape is used to represent start and end of the steps.
2. Parallelogram
This shape is used to represent input as well as output of the program
3. Arrow/Lines
This shape is used to represent the flow of the program steps
4. Rectangle
Rectangle shape is used to represent process of the program
5. Assigning box
The predefined constant is represented by this shape
6. Circle
The Perfect circle is used to connect different flow of the program.
Flowchart for finding sum of two given numbers
Rules of Flowchart
- Each symbol denotes a significant operation
- Uses only one start and stop point
- Flow lines should not cross each other normally
No comments:
Post a Comment
If you have any doubt, let me know...