You are on page 1of 13

BCS 1, BCSec 1 & BIT 1 10/29/2023

Contents
• Introduction
Basic Concepts
• Computers
• Computer Organization
David T. Makota
• Computer programs
Faculty of Computing and Mathematics
The Institute of Finance Management • Programming
Dar Es Salaam, Tanzania • Programmer
• Programming languages
• Software development
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
1 2
Solving Techniques Solving Techniques

Basic Concepts Basic Concepts

Lecture i - ii Introduction

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


3 4
Solving Techniques Solving Techniques

1
BCS 1, BCSec 1 & BIT 1 10/29/2023

Introduction Introduction
• People make decisions every day to solve problems • Steps to follow to ensure the best decision.
that affect their lives. – Identify alternative ways to solve the problem
– If a bad decision is made, time and resources are wasted • List should be as complete as possible.
• Steps to follow to ensure the best decision. • Alternative solutions must be acceptable ones.
– Identify the problem. – Select the best way to solve the problem from the
• If you don’t know what the problem is, you cannot solve it.
list of alternative solutions.
– Understand the problem.
• Identify and evaluate the pros and cons of each
• Knowledge base of the person or machine for whom possible solution
you are solving the problem.
• Select criteria for the evaluation.
• Your own knowledge base – Guidelines for evaluating each solution.
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
5 6
Solving Techniques Solving Techniques

Introduction Introduction
• Steps to follow to ensure the best decision. • Types of Problems
– List instructions that enable you to solve the problem using – Problems solved with a series of actions such as balancing a
the selected solution. check book or baking a cake
• Must fall within the knowledge base. • Algorithmic solutions
• No instruction can be used unless the individual or the machine – Solution can be reached by completing the actions in steps
can understand it. – These steps are called the algorithm
– Evaluate the solution. – Problems that require reasoning built on knowledge and
• check its result to see if it is correct and satisfies the needs experience
• If the result is either incorrect or unsatisfactory • Heuristic solutions
– Review the list of instructions to see that they are correct or start the process – Such as how to buy the best stock or whether to expand the company
all over again
– The problem solver can use the six steps for both
algorithmic and heuristic solutions.
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
7 8
Solving Techniques Solving Techniques

2
BCS 1, BCSec 1 & BIT 1 10/29/2023

Computers
• A computer is a device that can perform
computations and make logical decisions
billions of times faster than human beings can.
• The large computers introduced decades ago
were called mainframes
Basic Concepts
– Current versions are widely used today in homes,
Computers schools, business, government and industry.

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


9 10
Solving Techniques Solving Techniques

Computers Computers
• Silicon chip technology has made computing • Many of today’s personal computers can
so economical perform several billion additions per second.
– More than a billion general-purpose computers • Today’s fastest supercomputers can perform
are in use worldwide. thousands of trillions (quadrillions) of
– Billions more special purpose computers are used instructions per second!
in intelligent electronic devices like car navigation
– To put that in perspective, a quadrillion-
systems, energy-saving appliances and game
instruction-per-second computer can perform
controllers.
more than 100,000 calculations per second for
every person on the planet!
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
11 12
Solving Techniques Solving Techniques

3
BCS 1, BCSec 1 & BIT 1 10/29/2023

Computers Computers
• Computers process data under the control of • The programs that run on a computer are
sets of instructions called computer programs referred to as software.
– These programs guide the computer through • Hardware costs have been declining
orderly sets of actions specified by people called dramatically in recent years, to the point that
computer programmers. personal computers have become a
• A computer consists of various devices commodity.
referred to as hardware
– Keyboard, screen, mouse, hard disk, memory,
DVDs and processing units.

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


13 14
Solving Techniques Solving Techniques

Computer Organization

• Every computer may be envisioned as divided


into five logical units or sections:
– Input unit.
• This section obtains information (data and computer
programs) from input devices and places it at the
disposal of the other units so that it can be processed.
Basic Concepts • Humans enter information into computers through
keyboards and mouse devices.
Computer Organization • Information also can be entered in many other ways,
including by speaking to your computer, scanning
images/barcodes, reading from secondary storage
devices (hard drives, CD/DVD/USB drives)
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
15 16
Solving Techniques Solving Techniques

4
BCS 1, BCSec 1 & BIT 1 10/29/2023

Computer Organization Computer Organization

• Output unit. • Memory unit.


– This section takes information that the computer – This section retains information that has been
has processed and places it on various output entered through the input unit
devices to make it available for use outside the • Making it available for processing when needed.
computer. – The memory unit also retains processed
information until it can be placed on output
– Most information that is output from computers devices by the output unit.
today is displayed on screens, printed on paper,
– Information in the memory unit is volatile
played on audio players or used to control other • It’s typically lost when the computer’s power is turned
devices. off.

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


17 18
Solving Techniques Solving Techniques

Computer Organization Computer Organization

• Central processing unit (CPU). • Central processing unit (CPU).


– This section coordinates and supervises the – Many of today’s computers have multiple CPUs
operation of the other sections. • Can perform many operations simultaneously
– The CPU • Such computers are called multiprocessors.
• Tells the input unit when to read information into the • A multi-core processor implements multiprocessing on
memory unit a single integrated circuit chip
• Tells the ALU when information from the memory unit • A dual-core processor has two CPUs
should be used in calculations • A quad-core processor has four CPUs.

• Tells the output unit when to send information from


the memory unit to certain output devices.
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
19 20
Solving Techniques Solving Techniques

5
BCS 1, BCSec 1 & BIT 1 10/29/2023

Computer Organization Computer Organization

• Secondary storage unit. • Secondary storage unit.


– This is the long-term, high-capacity – Information on secondary storage devices is said
“warehousing” section. to be persistent
• it is preserved even when the computer’s power is
– Programs or data not actively being used by the turned off.
other units are placed on secondary storage • Secondary storage information takes much longer to
devices (e.g. hard drive) until they’re again access than information in primary memory
needed • The cost per unit of secondary storage is much less
than that of primary memory.
• possibly hours, days, months or even years later.
• Examples of secondary storage devices include CDs,
DVDs and flash drives (sometimes called memory
sticks)

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


21 22
Solving Techniques Solving Techniques

Computer Programs
• A computer program is one or more instructions that
are intended for execution by a computer.
• Computer programs may result from the compilation
or interpretation of programming languages, direct
result of hardware processing, or manually input to
the central processor of a computer.
Basic Concepts • A computer program does nothing unless its
Computer Programs instructions are executed by a central processor.

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


23 24
Solving Techniques Solving Techniques

6
BCS 1, BCSec 1 & BIT 1 10/29/2023

Computer programs Computer programs: cont


• A computer program expressed in a human-readable • Computer programs are generally specified
computer programming language is source code. using declarative, imperative, or visual
– Source code may be converted into an executable image programming methods.
by a compiler, or executed immediately with the aid of an – With the imperative approach, an algorithm is
interpreter. specified
• Compiled computer programs are commonly – With the declarative approach, the output is
referred to as executables, binary images, or simply specified and the implementation details are
as binaries hidden.
– A reference to the binary file format commonly used to – With a visual approach, program elements are
store the executable code. graphically manipulated rather than specified
textually.

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


25 26
Solving Techniques Solving Techniques

Computer programs: cont Computer programs: cont


• Computer programs may be categorized along • System Software
functional lines. – Programs that control and manage the basic operations of
– System software a computer.
– Application software – Includes the following types:
• Computer programs embedded in hardware devices • Operating System
– controls the internal operations of the computer’s hardware and
are called firmware. manages all of the devices connected to the computer.
• Utility Programs
– perform a specialized task that enhances the computer’s operation
or safeguards data.
• Software Development tools
– programs that are used to create, modify, and test software.

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


27 28
Solving Techniques Solving Techniques

7
BCS 1, BCSec 1 & BIT 1 10/29/2023

Computer programs: cont Computer programs: cont


• Application Software • Program execution
– Typically, computer programs are stored in non-volatile
– Programs that people normally spend most of memory until requested either directly or indirectly by the
computer user to be executed.
their time running on their computers performing – Upon such a request the program is loaded into random
everyday tasks are referred to as application access memory where it can be accessed directly by the
central processor.
software. – The central processor then executes ("runs") the program,
instruction by instruction, until termination, either by a
– For example: successful self-termination or by either a software or
• Word processing hardware error.
– Modern day multiprocessor computers or computers with
• Spreadsheet multicore processors may run multiple programs on a
single computer simultaneously.
• Database
• Presentation
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
29 30
Solving Techniques Solving Techniques

Programming
• Computer programming is the iterative process of
writing or editing source code of computer
programs, followed by testing, analyzing and refining
this code.
• Many aspects of programming
– Programming is controlling
• Computer does exactly what you tell it to
Basic Concepts
– Programming is teaching
• Computer can only “learn” to do new things if you tell it how
Programming – Programming is problem solving
• Always trying to make computer do something useful — eg:
finding an optimal travel route

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


31 32
Solving Techniques Solving Techniques

8
BCS 1, BCSec 1 & BIT 1 10/29/2023

Programming: cont
• Many aspects of programming: cont
– Programming is creative
• Must find a good solution out of many possibilities
– Programming is modelling
• Describe salient (relevant) properties and behaviours of a system
of components (objects)
– Programming is abstraction Basic Concepts
• Identify important features without getting lost in detail
– Programming is concrete
Programmer
• Must provide detailed instructions to complete task

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


33 34
Solving Techniques Solving Techniques

Programmer Programmer
• A programmer or software developer is someone • Application versus system programming
who programs computers, that is, one who writes – Computer programmers often are grouped into two broad
computer software. types:
• Applications programmers
• The term computer programmer can refer to a
• Systems programmers
specialist in one area of computer programming or to
– Applications programmers
a generalist who writes code for many kinds of • Write programs to handle a specific job, such as a program to track
software. inventory within an organization.
• One who practices or professes a formal approach to – Systems programmers
programming may also be known as a programmer • Write programs to maintain and control computer systems
software, such as operating systems and database management
analyst, software engineer, computer scientist, or systems.
software analyst.
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
35 36
Solving Techniques Solving Techniques

9
BCS 1, BCSec 1 & BIT 1 10/29/2023

Programming Languages
• Programming language
– Is an artificial language that can be used to control the
behavior of a machine, particularly a computer.
• Programming languages, like natural languages, are
defined by syntactic and semantic rules which
Basic Concepts
describe their structure and meaning
– Syntax
Programming Languages • Grammatical rules for forming instructions
– Semantics
• Meaning /interpretation of instructions

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


37 38
Solving Techniques Solving Techniques

Programming Languages Programming Languages


• programming languages allow you to express • Categories of programming languages
yourself more precisely than natural language – Machine language
– As a result, programs cannot be ambiguous • Machine is short for computing machine (i.e.,
computer)
• Computer’s native language
• Sequence of zeroes and ones (binary)
• Different computers understand different sequences
• Hard for humans to understand:
01010001...

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


39 40
Solving Techniques Solving Techniques

10
BCS 1, BCSec 1 & BIT 1 10/29/2023

Programming languages Programming languages


• Categories of programming languages • Categories of programming languages
– Assembly language – High-level languages
• Mnemonics for machine language • FORTRAN, Pascal, BASIC, C, C++, Java, Python, etc.
• Low level • high level
– Each instruction is minimal – Each instruction composed of many low-level instructions
• Still hard for humans to understand: • Closer to English and algebra
ADD.L d0,d2 • Easier to read and understand:

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


41 42
Solving Techniques Solving Techniques

Software Development: A 5-Step Process

Basic Concepts

Software Development
The Waterfall Model

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


43 44
Solving Techniques Solving Techniques

11
BCS 1, BCSec 1 & BIT 1 10/29/2023

Software Development Software Development


2) Designing the system
1) Analysis – Divide & conquer
• System is composed of smaller subsystems which in
– English description of system models, to meet a turn may be composed of even smaller subsystems
requirement or specification – Pseudocode
– Work with potential users to develop detailed • Somewhere between English and program code
specifications • describe tasks, subtasks, and how they relate
• May be written by non-programmer – Hand-simulation
• Desk-check pseudocode by stepping through it
without using a computer
– Often use diagrams to better communicate the
structure of the system

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


45 46
Solving Techniques Solving Techniques

Software Development Software Development


3) Implementing the design 4) Testing and Debugging
– Emphasis on good problem decomposition, well – Testing
• Submitting input data or sample user interactions and
structured design, and readable, well- seeing if program reacts properly
documented programming style • Typically done in stages, starting with individual
components and working up to subsystems, and
– Hand-simulate as you go, may need to backtrack eventually the entire program
and redesign – Debugging
– If design is good, most of the hard work should • Process of removing program bugs
be done – Bugs
• Errors in code or design

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


47 48
Solving Techniques Solving Techniques

12
BCS 1, BCSec 1 & BIT 1 10/29/2023

Software Development Software Development


5) Maintenance • Good program
– Finally, keep the program working and current – Satisfies the specification
– In a successful piece of software, maintenance is – Produced on time and within budget
often said to be 80% of the effort – User-centric design
• Result – Uses creativity to solve problem
– Working program – Well structured/organized/written/documented
• Solves original problem – Can be easily extended and maintained

CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem


49 50
Solving Techniques Solving Techniques

Summary
• Introduction
• Computers
• Computer Organization
• Computer programs
Basic Concepts • Programming
Summary • Programmer
• Programming languages
• Software development
CSU07101/ITU07101/CYU07106 - Problem CSU07101/ITU07101/CYU07106 - Problem
51 52
Solving Techniques Solving Techniques

13

You might also like