CS 101 Chapter 3
CS 101 Chapter 3
CS 101 Chapter 3
Learning Outcomes:
At the end of the topic, students should name and explain the components of
computer system, basic computer operations, distinguish the different types of computer
according to its applications, know the advantages and disadvantages of a High Level
and Low Level Languages, Understand on how to make a Python Classes in the
Integrated Development Environment (IDE) of Python Programming Language, and
Understand the different data types used in the Python Program.
Indicative Content:
• Computer Program
• Algorithm
• Source Code
• Properties of a Final Program
• Pseudocode
• Flowchart
Discussion:
Algorithm
- is a mechanical procedure that is guaranteed to eventually finish
- is an unambiguous specification of how to solve a class of problems
- a step-by-step procedure for solving a problem or accomplishing some
end especially by a computer
Procedure
- is a description of a process
- it is a list of steps
Process
- is a sequence of steps
- the act of following procedures
Mechanical procedure
- a procedure that can be followed without any thought
Computer Programming
- is the process of building and designing an executable computer
program for accomplishing a specific computing task
- is the process of writing or editing source code
Editing source code involves testing, analyzing, refining, and sometimes coordinating
with other programmers on a jointly developed program.
Source Code
- is any collection of code, possibly with comments, written using
a human-readable programming language, usually as plain text.
The source code of a program is specially designed to facilitate the work of
computer programmers, who specify the actions to be performed by a computer mostly by
writing source code. The source code is often transformed by
an assembler or compiler into binary machine code understood by the computer. The machine
code might then be stored for execution at a later time. Alternatively, source code may
be interpreted and thus immediately executed.
The source code of a program is written in one or more programming languages. The
purpose of programming is to find a sequence of instructions that will automate the
performance of a task for solving a given problem. The process of programming thus often
requires expertise in several different subjects, including knowledge of specialized
algorithms, and formal logic.
Reliability
How often the results of a program are correct. This depends on conceptual
correctness of algorithms, and minimization of programming mistakes such as logic errors.
Robustness
How well a program anticipates problems due to errors (not bugs). This includes
situations such as incorrect, inappropriate or corrupt data, unavailability of needed resources
such as memory, operating system services and network connections, user error, and
unexpected power outages.
Usability
The ergonomics of a program: the ease with which a person can use the program for
its intended purpose or in some cases even unanticipated purposes.
Portability
The range of computer hardware and operating system platforms on which the source
code of a program can be compiled/interpreted and run. This depends on differences in the
programming facilities provided by the different platforms, including hardware and operating
system resources, expected behavior of the hardware and operating system, and availability
of platform specific compilers for the language of the source code.
Maintainability
The ease with which a program can be modified by its present or future developers in
order to make improvements or customizations, fix bugs and security holes, or adapt it to new
environments. Good practices during initial development make the difference in this regard.
This quality may not be directly apparent to the end user but it can significantly affect the fate
of a program over the long term.
Efficiency/Performance
Measure of system resources a program consumes (processor time, memory space,
slow devices such as disks, network bandwidth and to some extent even user interaction): the
less, the better. This also includes careful management of resources, for example cleaning
up temporary files and eliminating memory leaks.
Pseudocode
Is a high-level informal tool that can be used to plan out algorithms.
It is a step-by-step verbal outline of code that can later transcribe into a programming
language.
It mimics the syntax of actual computer code.
It is more concerned with readability than with technical specificity.
Many programmers use it to plan out the function of an algorithm before setting
themselves to the more technical task of coding.
It serves as an informal guide, a tool for thinking through program problems.
A communication device that can help explain ideas to other people.
Used to show how a computing algorithm should and could work.
An intermediate step in programming, in between the initial planning stage and the
stage of writing actual, executable code.
Explaining a computing process to less technical people (non-programmers), may find
it easier to understand a more fluid, subjective language that clearly states the purpose
of each line of code.
Flowchart
A type of diagram that represents an algorithm, workflow or process.
Used in designing and documenting simple processes or programs.
Shows the steps as boxes of various kinds, and their order by connecting the boxes
with arrows.
These methods for a project can save time and ensure everyone is on the same page.
Exercises/Drills:
Prepared by:
RIO L. VERGABERA, ME
Course Facilitator