CSC 113 Computer Programming - Week 1
CSC 113 Computer Programming - Week 1
1
Computer programming i
Specific Objectives
2
Know the meaning of a problem and problem solving methods
Identify problem solving techniques
Specific Describe the programming language styles
objectives
Implement real-world problems using python programming language
CSC 112
Computer programming i
CSC 112
Computer programming i
Describe programming language styles – part A
Introduction to python programming language 4
CSC 112
Computer programming i
CSC 112
Computer programming i
Implement real-world problems using programming language
Generate problems 6
Analyse the problems
CSC 112
Computer programming i
What is a problem?
A problem is defined as an objective or specific output that we want to attain through a sequence of
7
steps and activities and with specific inputs.
Example:
Output or specific objective:
Baking of cake according to a user specification
inputs available: Activities or Specific
Input steps output
Ingredients like eggs, flour, milk, sugar etc
Steps or activities:
The steps and activities are done sequentially. These steps and activities are the actions taken to
achieve the specific objective.
Example: putting sugar
CSC 112
Computer programming i
What is Problem solving?
Problem solving is the process of identifying a problem, developing an algorithm for the identified 8
problem and finally, implementing the algorithm to develop a computer program.
The problem solving stages identify the sequential process that will be taken in solving a problem.
These include:
Understanding the problem
Analyzing the problem
Developing the solution
Coding and implementation
Documentation of the procedures
CSC 112
Computer programming i
Understanding a problem
9
Here we try to understand the problem to be solved by identifying the available input, expected or
required output and the operations (arithmetic and logical) to be executed.
CSC 112
Computer programming i
Analyzing a problem
10
After understanding thoroughly the problem to be solve, we look at different ways or methods of
solving the problem and evaluate each of these steps.
The idea here is to search for an appropriate solution to the problem under consideration.
The end result of this stage is a broad overview of the sequence of operations that are to be taken to
be carried out to solve the given problem.
By analyzing a problem, we should be able to figure out what are the inputs and the outputs that it
should produce.
CSC 112
Computer programming i
CSC 112
Computer programming i
Coding and implementation
12
The last stage of problem solving is the conversion of the detailed sequence of operations
(algorithm/flowchart) into a programming language that the computer can understand
Here, each step of the algorithm/flowchart is translated or converted into its equivalent instruction or
instructions in the computer language that has been chosen for the implementation.
This include:
Program design (coding)
Program implementation
The design phase involves the translation of the steps into equivalent instructions in the programming
language like C++, C, C#, Java and Visual Basic.
CSC 112
Computer programming i
CSC 112
Computer programming i
Program Documentation
14
Documentation is beneficial when more than one person participate in writing or modifying the
program.
Program documentation is a document that describes the configuration files, instructions and other
files that explain the program.
CSC 112
Computer programming i
Human versus computers in solving problem
15
People either converges or divergences in thinking to solving a problem or they do both.
Convergent thinking involves evaluating ideas and narrowing or reducing one’s options through the
imposition of value judgement, exploiting the information available about the ideas and then
prioritizing and selecting.
Divergent thinking operations involve searching for ideas and increasing one’s options through
elaboration of the problem and by exploring, connecting and/or combining potential ideas and
solution.
CSC 112
Computer programming i
Exploration and exploitation
16
Exploration is about searching for few ideas both inside or outside the paradigm.
Exploitation is about taking advantages of an idea within the paradigm and perfecting it
Some business problems require mostly exploitation, while other require mostly exploration, but
all problems require some mixture of the two.
Computer solves problem using ALGORITHM.
CSC 112
17
THANK YOU
FOR
LISTENING
THE END