You are on page 1of 17

PROBLEM SOLVING TECHNIQUE

2.1 Programming Cycle (SDLC/PDLC)

2.2 Developing algorithm (Flowchart; Pseudocode)

2.3 Control Structure (Sequential; Selection; Repetition)

By: Dr. Nickholas Anting Anak Guntor


Programming Cycle
Series of step or sequence for developing a softwares or products.

Software Development Life Cycle


Structural approach used for developing particular software
products.

Product Development Life Cycle


Process that is responsible for bringing to market a new product
and generally includes the business units.
By: Dr. Nickholas Anting Anak Guntor
By: Dr. Nickholas Anting Anak Guntor
By: Dr. Nickholas Anting Anak Guntor
By: Dr. Nickholas Anting Anak Guntor
Development of Algorithm
• Computer algorithm – an order sequence of instructions for solving
problem.
• Basic technique used to get the job done.

Example: The taxi algorithm


1. Go to the taxi stand.
2. Get in a taxi.
3. Give the driver my address.

By: Dr. Nickholas Anting Anak Guntor


By: Dr. Nickholas Anting Anak Guntor
By: Dr. Nickholas Anting Anak Guntor
Pseudocode
Features Examples:
▪ Cannot understand by Calculate the area of rectangular.
computer. BEGIN
INPUT & DECLARE length
▪ Jot down ideas using human- INPUT & DECLARE width
CALCULATE area = width * length
readable language – no worry DISPLAY area
syntax error. END

▪ Not standardized; every


program has its own version.

▪ Capitalized main key-


function. By: Dr. Nickholas Anting Anak Guntor
Flowchart
Features

▪ Used standardized
symbols.

▪ Can draw by hand or


word processor.

▪ Different symbols are


used for different states
in flowchart.

By: Dr. Nickholas Anting Anak Guntor


Examples of Flowchart
Example 1: Add two numbers entered Example 2: Find all the roots of a
by user. quadratic equation ax + bx + c = 0.

By: Dr. Nickholas Anting Anak Guntor


Control Structure
▪ Control Structures – Provide alternatives to sequential program execution and
are used to alter the sequential flow of execution.
▪ Most common control structures are:
Repetition/
Looping/

By: Dr. Nickholas Anting Anak Guntor


Basic Python Language with
Flowchart
Part 2

By: Dr. Nickholas Anting Anak Guntor


START #This program is to calculate area of rectangular

print (“This is BMI Calculator”)


DECLARE float
berat,tinggi,bmi #Declaring variable & gathering input
weight = float (input(“Enter Your Weight: ”))
height = float (input(“Enter Your Height in meter: ”))
INPUT berat, tinggi

#Calculating BMI (Process)


CALCULATE bmi = weight / (height * height)
bmi=berat/(tinggi * tinggi)

#DISPLAY BMI output


DISPLAY bmi print (“Your BMI is ”, bmi)

END

By: Dr. Nickholas Anting Anak Guntor


EXERCISE 1
A group of programmer has been assigned to make a simple sequential
program to calculate BMI index for users.

a) List the Input, Process and Output.


b) Create flowchart & pseudocode of the above situation.
c) Write a program based ion the flowchart using Python language.

BMI = weight / height2

By: Dr. Nickholas Anting Anak Guntor


By: Dr. Nickholas Anting Anak Guntor
QUIZ 1
A concert hall has three seating categories: Orchestra, Main floor, and
Balcony. Orchestra seats are RM25. Main floor seats are RM30 and
Balcony seats are RM15. The manager wants a program that allows him
to enter the number of tickets sold in each seating category. The
program should calculate and display the amount of revenue generated
by each seating category, as well as total revenue.

a) Create pseudocode of the above situation.


b) List the Input, Process and Output.
c) Create a flowchart for the above situation.

By: Dr. Nickholas Anting Anak Guntor

You might also like