Professional Documents
Culture Documents
Learning Outcomes:
By the end of this lesson, you should be able to Understand
the program development life cycle.
Click to edit Master title style
Requirements
• Identification of the problem: Before tackling a problem, it
needs to be clearly understood by everyone working on it.
Requirements: To create a solution, a requirements
document is created to define the problem and break it down
into clear, manageable, understandable parts by using
abstraction and decomposition.
Click to edit Master title style
Decomposition
• This is the act of breaking down a large problem into smaller, clear,
manageable and understandable sub-parts. Sub-parts can be divided until
they are easily solvable and cannot be broken down any further. An example
of decomposition could be getting ready in the morning to go to school
• Step 1: Wake up
• Step 2: Get breakfast
• Step 3: Brush teeth
• Step 4: Put clothes on
• Step 5: Make sure the bag and school supplies are ready
• Step 6: Find transport to school e.g. walk, bus, car, bike, etc
Click to edit Master title style
• These steps could be further subdivided, for example, “Step
2: Get breakfast” would entail:
• Step 2.1 Get a bowl
• Step 2.2 Get cereal
• Step 2.3 Get milk
• Step 2.4 Get a spoon
• Step 2.5 Put cereal in a bowl
• And so on…
Click to edit Master title style
• Decomposing a system
• To create an overall system and solve a problem, it must first
be broken down into subsystems that are easier to solve and
create. The act of breaking down the problem is known as
stepwise refinement
• Decomposing the problem this way creates smaller, more
manageable and more easily understandable sub-parts
Click to edit Master title style
Structure Diagrams
Flowcahrt
Click to edit Master title style
Pseudocode
• OUTPUT (“Enter the first number”)
• INPUT Num1
• OUTPUT(“Enter the second number”)
• INPUT Num2
• sum->Num1+Num2
• OUTPUT(sum)
Click to edit
Program python
Master title style
• Num1=input("Enter the first number")
• Num2=input("Enter the second number")
• Sum=int(Num1)+int(Num2)
• print(Sum)
Click to edit Master title style
Unit 7-Algorithm design and
problem solving
Pseudocode and programming
Computer science
Grade 8
Teacher Ms. Resmi
Date- 16/01/2024
Common
Click tokeywords used in title
edit Master pseudocode
style
• 1.BEGIN,END: Begin is the first statement and end is the last statement.
• 2. INPUT, GET, READ: The keyword is used to inputting data.
• 3.COMPUTE, CALCULATE: used for calculation of the result of the given expression.
• 4. ADD, SUBTRACT, INITIALIZE used for addition, subtraction and initialization.
• 5.OUTPUT, PRINT, DISPLAY: It is used to display the output of the program.
•
Click to-pseudocode
Rules edit Master title style
• Capitalize the construct keyword.
• Apply one construct per line unless pairing it with a construct
like IF-THEN.
• Use plain language that describes the problem.
• Use the phrase END plus the construct keyword to show that
an element of pseudocode is complete, such as ENDFOR and
ENDWHILE.
Click to edit Master title style
Solve
• Write algorithms and draw flowcharts for the following:
• Accept the age of a person and check whether he/she is
eligible to vote or not. A person is eligible to vote only
when he/she is 18 years or more.
• Draw a flowchart
• Write pseudocode
• Create a program in python
Click to edit Master title style
Flowchart
Click to edit Master title style
Pseudocode
• BEGIN
• INPUT age.
• IF age <=18 THEN
• PRINT “You are not eligible to vote"
• ELSE
• PRINT " You are eligible to vote "
• END IF
• END
Click to edit Master
Programming Pythontitle style