Chapter 1 Overview of Basic Programming
Chapter 1 Overview of Basic Programming
Objectives:
a.) Describe what is programming.
b.) Recognized the importance of programming process
c.) Compare and contrast in executing source code into a
program.
Nowadays computers are able to perform many different tasks, from simple mathematical
operations to sophisticated animated simulations. But the computer does not create these tasks
by itself, these are performed following a series of predefined instructions that conform what we
call a program.
A computer does not have enough creativity to make tasks which it has not been
programmed for, so it can only follow the instructions of programs which it has been programmed
to run. Those in charge of generating programs so that the computers may perform new tasks are
known as programmers or coders, who for that purpose use a programming language.
WHAT IS PROGRAM?
Page 1
CC02 MODULE FUNDAMENTALS OF PROGRAMMING
Compiler characteristics:
• Spends a lot of time analyzing and processing the program
• The resulting executable is some form of machine- specific binary code
• The computer hardware interprets (executes) the resulting code
• Program execution is fast
Interpreter characteristics:
• Relatively little time is spent analyzing and processing the program
• The resulting code is some sort of intermediate code
• The resulting code is interpreted by another program
• Program execution is relatively slow
PROGRAMMING PROCESS
All programming involves creating something that solves a problem. The problems can
range from something of great scientific or national importance, through to something as trivial as
relieving personal boredom!
Page 2
CC02 MODULE FUNDAMENTALS OF PROGRAMMING
This section describes one approach to solving such problems - think of it as a rough guide
to the things you should do when entering the land of programming.
The programming process consists of 5 steps. These are really only guidelines that have
come to be recognized as being part of writing good, easily understood, and useful computer
programs.
The programmer prepares a problem statement outlining the answers to the following
questions:
1. What is the job to be done?
2. What is the input data to be processed?
3. How is the data to be processed?
4. What is the desired format of the output?
A plan of action is prepared describing the processing sequence of the operations. The
plan may be in the form of a
1. Decision table – presents a complex situation, the conditions and the corresponding
actions.
2. Flowchart – shows the sequence of operations.
Programs are tested to locate and correct programming errors or bugs. programming errors are
due to:
1. Clerical error – Ex. Assigning the same statement number to two instructions
2. Logical error – ex. Omitting certain facts important to the whole system in a payroll
application.
Types of Errors
30
1. Compile-time error or syntax errors
Page 3
CC02 MODULE FUNDAMENTALS OF PROGRAMMING
2. Runtime Errors
➢ Compilers aren't perfect and so can't catch all errors at compile time.
➢ This is especially true for logic errors such as infinite loops. This type of error is
called runtime error
All data pertaining to a program are collected, organized, and recorded. A complete
documentation gives the following advantages:
DEFINITION OF TERMS
Coding - is the act of translating the design into an actual program, written in some form
of programming language. This is the step where you actually have to sit down at the
computer and type!
Programming- is then the task of describing your design to the computer: teaching it your
way of solving the problem
Compilation- is actually the process of turning the program written in some programming
language into the instructions made up of 0's and 1's that the computer can actually follow.
Debugging- is simply the task of looking at the original program, identifying the
mistakes, correcting the code and recompiling it.
Page 4
CC02 MODULE FUNDAMENTALS OF PROGRAMMING
➢ https://www.youtube.com/watch?v=quW5dAGpXiU
➢ https://www.youtube.com/watch?v=e4ax90XmUBc
➢ https://www.youtube.com/watch?v=AImF__7FyzM
REFERENCES
❖ https://dev.to/lucpattyn/basic-programming-concepts-for-
beginners-2o73
❖ https://codewithchris.com/learn-programming/
❖ https://docs.microsoft.com/en-us/dotnet/csharp/programming-
guide/concepts/
Page 5