Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CS 101 Chapter 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

MODULE ON INTRODUCTION TO COMPUTING

Course Title: Introduction to Computing


Course Number: CMSC 102
Course Description:
The course introduces the basic concepts of computer programming languages
specifically using Python Programming. This course also discuss the structures of
program, proper declaration of variables, data types, functions, objects, inheritance, and
polymorphism in regards to Object Oriented-Programming (OOP). The students will
acquire skills and knowledge in working with codes using Python Programming
Language.

Total Learning Time: 94 hours


Pre-requisites: None
Overview:
This module serves as a guide on basic concepts of computer programming. The
students will acquire skills and knowledge in working with codes using Python
Programming Language.

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:

CHAPTER 3. PROGRAMS, PROCESSES AND PROCEDURES

Computer Program - is a collection of instructions for performing a specific task


that is designed to solve a specific class of problems.

The instructions of a program are designed to be executed by computer and it is


required that a computer is able to execute programs in order for it to function.

The method applied by a computer to execute the instructions of a computer program


is called an algorithm.

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.

Fundamental Properties a Final Program Must Satisfy

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.

Flowchart provides a graphical structure that allows programmers to follow the


logical structure of the code.

Pseudocode uses words as opposed to a pictorial representation to illustrate the logic


of the algorithm.

These methods for a project can save time and ensure everyone is on the same page.

Exercises/Drills:

1. Write a pseudocode of enrolment process flow in your department.


2. Design/create a flowchart of a program that asks a user to enter a number. Determine
and display whether if the number entered is an odd or even number.
References:
• A Practical Introduction to Python Programming by Brian Heinold/ebook
• Getting Started with Python and IDLE/ebook
• A Python Book: Beginning Python, Advanced Python, and Python Exercises by Dave
Kuhlman/ebook
• Python Basics/ebook

Prepared by:

RIO L. VERGABERA, ME
Course Facilitator

You might also like