Você está na página 1de 3

CSC128

Mahfudzah Othman
UiTM Perlis

CHAPTER 1

INTRODUCTION TO PROGRAMMING AND STAGES INVOLVED IN WRITING


A PROGRAM

The basic concept of computer

What is a computer?
It is an electronic device that can input and store a set of instruction, input and
store data, process the stored data according to the instructions and finally
produce output to be relayed to its user.

Classifications of computer:
- Microcomputer
- Minicomputer
- Mainframe
- Supercomputer

What is computer program?


A set of instruction that performs a specific task called a program.

Why we need a program?


Because a program can solve problems

What is problem solving?


Is the process of transforming the description of a problem into the solution of
that problem by using our knowledge of the problem domain and by relying on
our ability to select and use appropriate problem solving strategies, techniques
and tools.

Example : Prepared to school

Wake up What happen Wake up


Brush a teeth if we change Brush a teeth
Wash a face the scenario Wash a face
Bath Wear a shirt
Wear a shirt Bath
Breakfast Breakfast
Go to school Go to school

1
CSC128
Mahfudzah Othman
UiTM Perlis

Definition of terminology of the computer

What is a programming language?


Machine language – language made up of binary-coded instructions that use
directly by the computer.

Assembly language is a low level programming language in which a mnemonic


is used to represent each of the machine language instructions for a particular
computer.

Assembler is a program that translates an assembly language program into


machine code.

Compiler is a program that translate a high language into machine code

Source program is a program written in a high level programming language.

Object program is the machine language version of source program.

Compilation vs Execution

During compilation the computer runs the compiler program and produces the
object program. During execution the object program loaded into computer’s
memory and the computer runs the object program, doing whatever the program
instruct it to do.

In this subject, we will use the C++ language to do our program so before we
used it, we must know the concept of C++.

Environment of C++:

i) Editor
Is a special software that can be used to create text, edit it and save it as
a file using the keyboard and monitor.

ii) Preprocessors
It checks the C++ program for special instructions.

iii) Compiler
Is the software that converts a computer program written into a language
that can be understood by the computer. Translate from source code into
machine code.

iv) Linker
Is a component of the compiler, automatically combines the object code
that we need to produce executable code.

2
CSC128
Mahfudzah Othman
UiTM Perlis

v) Loader
Is a program that loads the executable code into the main memory for
execution.

vi) CPU
CPU takes each instruction and executes it, possibly storing new data
names as the program executes.

A SKELETOR OF C++ PROGRAM

#include <iostream.h>

void main()
{
//instruction statement;
return 0;
}

Você também pode gostar