BMS 201 Programming Methodology 2021
BMS 201 Programming Methodology 2021
Computer
programming
STEPS IN PROGRAM DEVELOPMENT
Generate program objectives/Problem Defn
Design program / Algorithm Development
Write the program Code/Coding
Compile the code
Execute or run the program
Test and debug the program
Maintenance and modification
Documentation of Software
FLOWCHART DEVELOPMENT
Flowcharts are Pictorial representation of the program
logic
They help analyze the problem in more effective way.
Program flowcharts serve as a good program
documentation.
Act as a guide during the systems analysis and program
development phase.
The flowchart helps in debugging process.
Provides means of communication with others about
the program
TYPES OF FLOW CHARTS
system
System flowcharts: showing controls at a
terminal symbol.
1. Start
2. Product = 1
3. Count = 0
4. Input number Num
5. Sum = Sum + Num
6. Count = Count + 1
7. If Count < 35 then
8. Go to step 4
9. Else
10. Print Sum
11. End if
12. End
GUIDELINES FOR DRAWING A FLOWCHART
Example 1
Write an algorithm that can be used in calculating and
flowchart
Draw a flowchart to find the largest of three numbers
A, B and C.
1. Start
2. Sum = 0
3. Count = 0
4. Input number Num
5. Sum = Sum + Num
6. Count = Count + 1
7. If Count < 3 then
8. Go to step 4
9. Else
10. Print sum
11. End if
12. End
LIMITATIONS OF USING FLOWCHARTS
method
ALGORITHM
1. Start
2. Num = 0
3. Sum = 0
4. Sum = sum + num
5. Num = num + 1
6. If num <= 20 then
7. Go to step 4
8. Else
9. Print sum
10. Stop
Flow Chart Exercises
A supermarket is planning to give discounts to its
customers based on the total costs of purchases made by
the customer. Discounts are given as follows:
Total sales exceeding 5000/=, discount is 8%
Sales greater than 3000/= and less than 5000/=, discount
is 5%
Sales greater than or equal to 1500/= and less than
3000/=, discount is 2%
Sales less than 1500/=, no discount
Required: Develop an algorithm and draw up a flowchart
for a program that can be used to control this process
ALGORITHM
1. Begin
2. Get Totsale (Total Sales)
3. If Totsale > 5000 then
4. Discount = 8% * Totsale
5. Elseif Totsale >=3000 and Totsale < 5000 then
6. Discount = 5% * Totsale
7. Elseif Totsale >=1500 and Totsale < 3000 then
8. Discount = 2% *Totsale
9. Else
10. Discount =0
11. Print Totsales
12. Print Discount
13. End