0% found this document useful (0 votes)
19 views40 pages

Topic 1 - Problem Solving Technique in Programming

This document provides an overview of problem solving techniques and programming concepts. It discusses computational thinking, the software development life cycle (SDLC), and computer programming tools like pseudocode and flowcharts. The SDLC is described as a process with five stages: requirements gathering, design, development, testing, and deployment/maintenance. Common programming languages and the goals of each SDLC stage are also outlined.

Uploaded by

Khant Eaint Hmoo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views40 pages

Topic 1 - Problem Solving Technique in Programming

This document provides an overview of problem solving techniques and programming concepts. It discusses computational thinking, the software development life cycle (SDLC), and computer programming tools like pseudocode and flowcharts. The SDLC is described as a process with five stages: requirements gathering, design, development, testing, and deployment/maintenance. Common programming languages and the goals of each SDLC stage are also outlined.

Uploaded by

Khant Eaint Hmoo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

TOPIC 1

Problem Solving Technique


FCC124 INTRODUCTION TO PROGRAMMING

Centre for Foundation Studies


Learning Outcome

1.1 Understand the concept of computational thinking


1.2 Define and understand a software development process.
1.3 Understand the computer programme development
1.4 Apply the pseudocode and flowchart as a computer programming tool
Overview

This topic covers:


1.1 Computational Thinking
1.2 Software development life cycle
1.3 Computer program development
1.4. Computer programming tool - Pseudo code & flowchart
Introduction

Programming language is a computer language that is used by programmers


to communicate with computers. It is a set of instruction written in any specific
language to perform specific task.

Syntax is a computer language is the rules that define the combinations of symbols that are considered to
be correctly structured statements or expressions in that language. This applies both to programming
languages, where the document represents source code, and to markup languages, where the document
represents data.
Introduction
Introduction

Top Programming Language:


❖ Javascript
❖ Python
❖ PHP
❖ C
❖ Perl
❖ HTML
1.1 Computational Thinking
❖ Computational thinking is solving problems effectively with or without computer.
❖ The computational thinking help in solving problems, designing system and understanding the power and
limit of human.
❖ The problem solving is an important skill for computer sciences includes: -
❏ ability to formulate problems,
❏ ability to think creatively about solutions
❏ express a solution clearly and accurately.
❖ The Programming is the process of problem solving and translating the solutions into computer
programming language.
❖ A programmer need to have a skill of thinking ability to produce solutions and knowledge about
programming language.
1.2 Software Development Life Cycle

SDLC stands for Software Development Life Cycle

❖ It is a process that gives a complete idea about developing, designing, and maintaining a software project by
ensuring that all the functionalities along with user requirements, objectives, and end goals are addressed. With
SDLC, the software project’s quality and the overall software development process get enhanced.

❖ Benefits of SDLC as follows:


➢ Address the goals and problems to implement the project with the highest precision and accuracy
➢ SDLC does not allow the project members to proceed ahead before completion & approval of the prior
stages
➢ Installation in the project executed with SDLC has necessary checks to be tested with precision before
entering the installation stage
➢ With a well-defined SDLC in place, project members can continue the software development process
without incurring any complications.
➢ SDLC offers optimal control with minimum problems, allowing the project members to run the project
smoothly
1.2 Software Development Life Cycle
Stage 5: Deployment &
Maintenance Phase Stage 1:
Once the system testing is Requirement Gathering &
done, it is ready to be Analysis
launched. Phase
First and most crucial phase for a
Stage of SDLC- software project’s success.
Software
development life
Stage 4: Testing cycle
Testing phase is refer to
checking, reporting and fixing Stage 2:
the system for any bug/defect. Design Phase
The architecture design is
proposed for the project based
on the Software Requirement
Stage 3: Development Phase
Specification (SRS) document
In this phase the actual project is developed
requirements.
and built.
1.2 Software Development Life Cycle

Stage 1 Stage 2
Requirement Gathering & Analysis Phase Design Phase
In an SDLC, this is the first and most crucial phase for a software In the design phase of an SDLC, the architectural design
project’s success. In this phase, communication takes place
is proposed for the project based on the Software
between stakeholders, end-users, and project teams, as both
functional and non-functional requirements are gathered from
Requirement Specification (SRS) Document
requirements.
customers.

The Requirement Gathering & Analysis Phase of SDLC involves the The Designing Phase of SDLC involves the following:
following:
1. Separation of hardware and software system
1. Analysis of functionality and financial feasibility requirements
2. Identifying and capturing requirements of stakeholders through 2. Designing the system architecture based on
customer interactions like interviews, surveys, etc.
3. Clearly defining and documenting customer requirements in an gathered requirements
SRS (Software Resource Specification Document) comprising of 3. Creating Unified Modelling Language (UML)
all product requirements that need to be developed diagrams like- use cases, class diagrams,
4. Creating project prototypes to show the end-user how the sequence diagrams, and activity diagrams
project will look
1.2 Software Development Life Cycle

Stage 3 Stage 4
Development Phase Testing Phase

In the entire SDLC, the development phase is considered Almost all stages of SDLC involves the testing strategy.
to be the longest one. In this phase, the actual project is However, SDLC’s testing phase refers to checking,
reporting, and fixing the system for any bug/defect. In this
developed and built.
phase, the on-going system or project is migrated to a
test environment where different testing forms are
The Development Phase of SDLC involves the following: performed. This testing continues until the project has
achieved the quality standards, as mentioned in the SRS
1. Actual code is written document during the requirement gathering phase.
2. Demonstration of accomplished work presented
before a Business Analyst for further modification of The Testing Phase of SDLC involves the following:
work
1. Testing the system as a whole
3. Unit testing is performed, i.e., verifying the code
2. Performing different types of test in the system
based on requirements 3. Reporting and fixing all forms of bugs & defects
1.2 Software Development Life Cycle

Stage 4
Deployment & Maintenance Phase

In the entire SDLC, once the system testing has been done, it is ready to be launched. The system may
be initially released for limited users by testing it in a real business for UAT or User Acceptance Testing.

The Deployment & Maintenance Phase of SDLC involves the following:

1. The system is ready for delivery


2. The system is installed and used
3. Errors are rectified that might have been previously missed
4. Enhancing the system inside a data center
1.2 Software Development Life Cycle

SDLC Model

Various SDLC models are defined and designed to follow the software
development process. These models are also known as Software
Development Process Models. Each of these models follows a series of
steps for ensuring the complete success of a project.
1.2 Software Development Life Cycle

Example of SDLC models: -

❖ Agile Model
❖ Spiral Model
❖ Waterfall Model
❖ Iterative-Incremental Model
❖ Rapid Action Development
(RAD) Model
1.2 Software Development Life Cycle

This model is the most


commonly used SDLC
model. In this model,
each phase starts only
after the previous step
has been completed.
This is a linear model
having no feedback
loops.
1.2 Software Development Life Cycle

Strengths of the Waterfall Model: - Weakness of the Waterfall Model: -


➢ Achievements are well-defined ➢ It cannot match reality well
➢ Easy to understand and use ➢ Difficult to make changes
➢ Defines requirements stability ➢ It cannot match reality well
➢ Works well when the project quality is ➢ Testing begins only after the
important development is complete
1.2 Software Development Life Cycle

Iterative Incremental Model


In this model, in the initial stages a partial implementation of the complete system
is constructed such that it will be present in a deliverable form. Increased
functionalities are added and for any defects, they are fixed with the working
product delivered at the end. This process is repeated until the product
development cycle gets completed. These repetitions of process are known as
iterations. With each iterations, a product increments gets delivered.
1.2 Software Development Life Cycle
1.2 Software Development Life Cycle

Strengths of the Iterative Incremental Model: Weakness of the Iterative Incremental Model: -
- ➢ There are requirements for effective
➢ Prioritized requirements can be initially iterations planning
developed ➢ Efficient design is required for including the
➢ The initial delivery of the product is required functionalities.
faster ➢ An early definition of a complete, as well as
➢ Lower initial delivery costs fully functional system, is needed for
➢ Changes in requirements can be allowing increments definitions
easily adjusted ➢ Clear module interfaces are required
1.2 Software Development Life Cycle

Spiral Model
The spiral model combines risk analysis along with RAD prototyping to the
Waterfall model. Each of the cycles has the same steps as in the case of the
Waterfall model.
1.2 Software Development Life Cycle
1.2 Software Development Life Cycle

Strengths of the Spiral Model: - Weakness of the Spiral Model: -

➢ Users can have a look at their system ➢ The spiral may go on indefinitely

early due to rapid prototyping tools ➢ The spiral model can be complex to

➢ Users are involved in all lifecycle stages understand for new numbers

➢ An early indication of risks can be ➢ It may be hard to set the objectives, verifiable

provided, without incurring much cost milestone for indicating preparedness to go

➢ Critical & high risk functionalities are ahead with the next iteration

initially developed ➢ Time spent on addressing risks can be large


for smaller & low-risk involved projects
1.2 Software Development Life Cycle

Agile Model
The agile model is the combination of the iterative-incremental model that
depends depends on process adaptability along with customer satisfaction
through the delivery of software products. In this model, the project is broken
down into smaller time frames for delivering certain features during a release.
1.2 Software Development Life Cycle
1.2 Software Development Life Cycle

Strengths of the Agile Model: - Weakness of the Agile Model: -

➢ Easy to accommodate any user ➢ Hard to use and implement with legacy

changes systems

➢ Reduced cycle time and enhanced ➢ Heavily dependent on technically strong

productivity with minimal team members members for identifying business requirement

➢ Customer’s continuous involvement


ensures minimal risks of not achieving
customer satisfaction
1.2 Software Development Life Cycle

Rapid Application Development (RAD)


Model
The RAD SDLC model is based on prototyping and iterative development, with no
involvement of a defined planning structure. In this model, different function
modules are parallely developed as prototypes and then integrated to speed up
product delivery.
1.2 Software Development Life Cycle
1.2 Software Development Life Cycle

Strengths of the RAD Model: - Weakness of the RAD Model: -

➢ Easy to accommodate changing ➢ Not ideal for handling complex

requirements. dependencies

➢ Regular communication takes place ➢ Teams need to have the desired experience

between customers and developers. levels for adhering method rules.

➢ Functionalities can be developed


quickly and demonstrated to customers.
1.3 Computer Program Development

One technique used by professional software developers for understanding the problem that is being
solved and for creating an effective and appropriate solution is called the software development
procedure.

4 steps in Problem Solving Process

❖ Analyzing the problem


❖ Developing an algorithm
❖ Writing the program (by the programmer, including internal commenting)
❖ Testing the program (by the programmer as well as the user)
1.3 Computer Program Development

Development Testing the program


and design
steps Writing the program

Develop a algorithm
Analyze the
problem
Time
Problem Analysis:

•Before writing any program, a programmer must clearly understand the problem, what
input are to be used, the desired output, the procedure that will produce the result
and the constraints to be considered.

•The analysis starts by answering these questions:


•What would be considered the input data?
•What would be considered the output?
•Are there any special conditions/constraints?
1.3 Computer Program Development
Writing Algorithm:

❖ write the algorithm in pseudocode or flowchart


❖ need to identify the basic steps clearly in the correct order that can transform input to output specified in
problem analysis phase
❖ typically, the steps follows a familiar pattern: input,processing and output
❖ test is to verify the correctness of the algorithm (hand trace the values of the variables in every steps of
your algorithm)

Test Algorithm:

• pretend that you are the computer and follow the steps of your algorithm explicitly while keeping track of
how the variables are changing.

• hand trace the values of the variables in every steps of your algorithm
1.3 Computer Program Development
Coding:

• develop the program by coding the algorithm in a programming language, such as Java and implement the
program to the user environment such as Android

• need to have knowledge in the programming language in terms of the language syntax

• can use IDEs such as Eclipse, NetBeans etc to facilitate the coding tasks.

Testing/Debugging Program:

•test to verify that the program meets the requirements by creating test cases

• test can avoid bugs such as logic errors

• program also need to be maintained by modifying it if the problem domain or requirements changes or
problem arises
1.4 Computer Programming Tool

An algorithm is a clear step–by-step


sequence of instructions to solve a
problem

• In mathematics and computing, an


algorithm is a procedure (a finite set
of well-defined instructions) for
accomplishing some task which,
given an initial state, will terminate in
a defined end-state.
1.4 Computer Programming Tool

Two ways to represent algorithm:


a) pseudo code
Simple way of writing programming code in English, is not actual programming
language. It uses short phrases to write a code for programs before you actually
create it in specific language.

b) flowchart
using diagrams that employ symbols to describe the workflow of steps involved in
the solution. Flowchart were used to map out programs before writing one line of
code in language.
1.4 Computer Programming Tool

Pseudocode

Pseudocode statements usually perform input, output, and processing (eg.


arithmetic operations)
The input statements are to get data needed to perform computation e.g.:
◦ Input student name, student mark
◦ Input length, width, height of a box
◦ Input loan amount, interest rate, loan duration
The output statements are to display information for the user e.g.:
◦ Output "Enter Student Name: "
◦ Output final grade
◦ Output "The volume of the box is ", theVolume
◦ Output "The loan montly payment = ", monthlyPayment
1.4 Computer Programming Tool
Pseudocode

The processing statements are to perform computation


e.g.:
◦ priceAverage = (price1 +price2 + price3 + price4 + price5) / 5
◦ theVolume = length x width x height
◦ BMI = weight / (height x height)
These statements represent arithmetic assignment statements. The right side
of the statement is the arithmetic expression using standard mathematical
notation.
The left side is where the result of the computation is stored for further
processing.
1.4 Computer Programming Tool

Pseudocode
Question: Calculate the perimeter of a rectangle

Start
Output "Enter rectangle length: "
Input length
Output "Enter rectangle width: "
Input width
Calculate perimeter = 2 x(length + width)
Output perimeter
End
1.4 Computer Programming Tool
A graphical way of depicting a problem in terms of its inputs, outputs, and processes. The basic elements are as follows:

Symbol Name Description

Indicate the beginning or end


Terminal of the algorithm

Input/Output Indicate an input or output


Parallelogram operation

Process Indicate computational or


Rectangle data manipulation

Decision Indicate a program branch


Diamond point

Connect the flowchart


Flow line symbol
1.4 Computer Programming Tool
Start

Input three values

Question 1:
Calculating the average of three number Calculate the average

Display the average

End
1.4 Computer Programming Tool
Start

Input length, width


Question 2:
Calculate the perimeter of Perimeter = 2 x (length +
a rectangle width)

Output perimeter

End

You might also like