Introduction to
Programming
Information System in
business
Information System is a
combination of technology and
people to:
Collect data
Store data
Transform data into information
Data and Information
Data is a raw facts that collected
and stored by IS
Numbers, alphabets, dates, amounts,etc
Information is data that has been
processed into a usable
meaningful form
Reports, documents, charts
Data and Information
Input
Data
System / IS
Processing
Output
Information
Software
Software
Program
Controls the operation of the computer
System Software, Application Software,
Programming Languages
List of step by step instruction to the
computer.
Programming
Process of creating a program
Software Development
Is the process of creating a new
information system or updating an
existing one
Four steps in software
development
Planning
Analysis
Design
Implementation
Six Basic Computer
Operations
Input Data
Store Data
Perform Arithmetic Operation
Make decisions
Repeat Operations
Output data
Computer Operation
Data
Memory
Processor/Processing
3
4 Chip
5
Perform
Make
Repeat
Arithmetic Decisions Operation/s
Information
Programs and
Programming
The computer only knows what is
told through programs, so they
must be accurate and very
specific.
The process of creating programs
is programming.
A program follows a step-by-step
logic algorithm to solve a
problem.
Note: never a attempt to program before
Control Structures
Control Structure is the logic
behind the program.
Sequence: Input, Storage, Arithmetic
and output
Decision: comparing two values an
selecting one.
Repetition: Going through loop
Programming Language
is a set of restricted vocabulary and
structured syntax that a computer can
understand
is a language used to write computer
programs, which involve a computer
performing some kind of computation or
algorithm and possibly control external
devices such as printers, robots, and so
on.
Programming Language
Level of Computer Languages
Low level : at the level of the computer
Intermediate Level : close to computer
language but uses English language
Binary format
Assembler
High Level: at the level of programmer
using English words and clearly defined
syntax
Translated to binary to implement it
Need software program for conversion
Programming Language
Graphical Representation
Total = 0
A=1
B=2
Total = A + B
Translation
Program
0110101011
0100101
01011010
01010010
High level to Binary
Interpreted
Compiled
Translated each statement as it is
executed
The entire program is converted to
binary form.
VB is interpreted during creation
and testing but can be compiled
into an .exe file.
Programming Language
Types of Computer Language
Procedural: Monolithic program that
runs from the start to finish with no
intervention from user other than
input.
C
Basic
Object Oriented/Event Driven:
programs that use objects which
responds to events;
Visual Basic
Object Oriented/ Event
Driven Programming
OOED uses objects
OOED is easier to work with
Properties
Methods
Events
OOED Programming
Process
The six process for writing an
OOED computer program:
Define problem
Create Interface
Develop Logic Actions for objects
Write and test code for action objects
Test overall project
Document project in writing
OOED Programming
Process
Step One: Define Problem
Define the problem clearly
This may involve a study of the problem
to understand the input and outputs
Identify the data to be input to the
program and the results to be output
from it
Sketching the interface
Denote input and output as well as action
objects
OOED Programming
Process
Step One: Define Problem
Boks Video Rental
Input
Price
Taxes
Amount due
Calculate
Action
Objects
Output
Log-out
OOED Programming
Process
Step Two: Create Interface
Once you have define the problem and
sketched the interface, you are ready to
create the interface of the program.
For Boks Video Rental
Textboxes
Buttons
Labels
OOED Programming
Process
Step Two: Create Interface
OOED Programming
Process
Step Three: Develop logic for
Action Objects
Logic: step by step process of solving a
problem
What each object should do in response
to an event
Use Input/Processing/Output (IPO) Table
or Pseudocode to develop the logic.
IPO Table: program that show inputs,
outputs and processing to convert inputs
to outputs
Develop logic for Action
Objects
Using IPO Table for Calculate
Button
Input
Video Price
Processing
Taxes = 0.70 x Price
Amount Due = Price
+ Taxes
Outpu
t
Taxes
Amount Due
Develop logic for Action
Objects
Using Pseudocode
Pseudocode is a program written in
English (natural) language rather than
computer language.
A Pseudocode program is useful for
two reasons:
The programmer may use it to structure
the algorithmic logic in writing
It provides a relatively direct link between
the algorithm and the computer program.
Develop logic for Action
Objects
1.
2.
3.
4.
Using Pseudocode
Input Video Price
Taxes = 0.70 x Video Price
Amount Due = Video Price +
Taxes
Output Taxes and Amount Due
OOED Programming
Process
Step Four: Write and Test Codes for
Action Objects
Convert the logic into computer
languages
Test each code for each action object
as they are created
Debugging removing bugs
Write and Test Codes for Action
Objects
VB Code for Calculate Button
Private Sub cmdCalculate_Click()
Dim Price as currency
Dim Taxes as currency
Dim Amount_due as currency
Price = txtprice.text
Taxes = 0.70 * Price
Amount_Due = Price + Taxes
TxtTaxes.text = Taxes
TxtAmountDue.text = Amount_Due
End Sub
OOED Programming
Process
Step Five: Test Overall Project
Test the the program in the actual
environment and on the actual data.
OOED Programming
Process
Step Six: Document Project in
Writing
Documentation includes the pictorial and
written description of the program or
software
End of the
Presentation
Part 1
Introducing Computer
Science:
The Study of Algorithms
Goals
By the end of this lecture you should
Understand the role of a computer
as a tool in Computer Science.
Understand Computer Science as
the study of algorithms.
Be able to identify how algorithms
are developed & evaluated.
The Computer as a Tool
Much like the microscope does not
define biology or the test tube
does not define chemistry, the
computer doesn't define Computer
Science.
The computer is a tool by which
Computer Scientists accomplish
their goals to solve problems.
What is Computer
Science?
NOT about coding or hardware or
software!
Computer Science is about
PROBLEM SOLVING
Computer Science is about
DEVELOPING ALGORITHMS to
solve complex problems
What is Computer
Science?
described as the systematic study of
algorithmic processes that create,
describe, & transform data into
information.
study of the theoretical foundations
of information and computation, and
of practical techniques for their
implementation and application in
computer systems
What is an Algorithm?
A sequence of unambiguous
instructions for solving a problem,
i.e., for obtaining a required output
for any legitimate input in a finite
amount of time.
Algorithms are used for
calculation, data processing
list of well-defined instructions for
completing a task
What is an Algorithm?
An algorithm is a well-developed,
organized approach to solving a
complex problem.
Computer Scientists ask
themselves four critical
questions when they evaluate
algorithms
Algorithm Questions
Does the algorithm solve the
stated problem?
Is the algorithm well-defined?
Does the algorithm produce an
output?
Does the algorithm end in a
reasonable length of time?
Developing an Algorithm
1.
2.
3.
4.
5.
Identify the Inputs
Identify the Processes
Identify the Outputs
Develop a HIPO Chart
Identify modules
1. Identify the Inputs
What data do I need?
How will I get the data?
In what format will the data be?
2. Identify the Processes
How can I manipulate data to
produce meaningful results?
Data vs. Information
3. Identify the Outputs
What outputs do I need to return to
the user?
What format should the outputs
take?
4. Develop a HIPO Chart
Hierarchy of Inputs Processes & Outputs
5. Identify Relevant
Modules
How can I break larger problems
into smaller, more manageable
pieces?
What inputs do the modules need?
What processes need to happen in
the modules?
What outputs are produced by the
modules?
Importance of Algorithm
Using an algorithm in planning for a
solution helps in several ways:
First, it allows the individual to see
things in a wider perspective thereby
weeding through all other possible
solutions to pick the best one. Since in
coming up with an algorithm the
individual is not stuck with using a
specific language, the person may use
whatever tool (i.e. flowchart, layman's
term, etc.) that is comfortable; putting
emphasis on how to go about solving an
Importance of Algorithm
Second, algorithms serve as the
framework to which the actual
solution is patterned after. This guides
the individual in the process of
deriving the solution, thus saving
time and effort as compared to
having one jump immediately to this
stage without any plan.
Importance of Algorithm
Lastly, algorithms can become
generic templates to which other
issues may refer to for solutions. If
properly documented or easily
recalled, an algorithm used to solve
one problem can guide the individual
in resolving another one of similar
nature.
Properties of Algorithm
1) Finiteness: - an algorithm terminates
after a finite numbers of steps.
2) Definiteness: - each step in algorithm is
unambiguous. This means that the
action specified by the step cannot be
interpreted (explain the meaning of) in
multiple ways & can be performed
without any confusion.
3) Input:- an algorithm accepts zero or
more inputs
Properties of Algorithm
4) Output:- it produces at least one
output.
5) Effectiveness:- it consists of
basic instructions that are
realizable. This means that the
instructions can be performed by
using the given inputs in a finite
amount of time.