cp3 Notes GRD 12
cp3 Notes GRD 12
Objectives:
• >to review the basic computer systems concept
• >to be able to understand the different computing environments and their components
• >to review the history of computer language
• >to be able to list and describe the classifications of computer language
• >to understand the steps in the development of a computer program
• >to review the system development life cycle
Computer System - combination of all the components required to process and store data using a
computer.
Two Major Components of Computer:
1. Hardware – is the equipment or the physical devices associated with a computer. Hardware
component of computer system consist of five parts: Input devices, CPU, primary storage, output
devices & auxiliary storage.
- Input devices – programs and data are entered into the computer (Ex. Mouse, touch screen,
audio input.
-CPU(Central Processing Unit ) – responsible for executing instructions such as arithmetic
calculations , comparison among data and movement of data inside the system.
- Primary Storage – known as the main memory, a place where the programs and data are
stored temporarily during processing.
-Output Device- monitor or a printer to show output.
-Auxiliary Storage- known as secondary storage, used for both input and output
2. Software – a computer instructions that tell the hardware what to do.
Software is divided into two broad categories:
1. System Software – consist of programs that manage the hardware resources of a
computer and perform required information processing tasks.
Programs are divided into three classes:
1. Operating System- provides services such as a user interface, file and database access, and
interfaces to communication system such as Internet protocols.
2. System Support Software- provides system utilities and other operating services. It also
provides performance statistics for the operational staff and security monitors to protect the system
and data.
3. System Development Software- it includes the language translator that convert programs into
machine language for execution, debugging tools to ensure that the programs are error free.
2.Application Software- comprises all the programs you apply to a task. This includes OS such as
Windows , LINUX, UNIX for larger computers google android and apple IOS for smartphones.
Three major operations of Hardware & Software in most programs:
o 1. INPUT
o 2. PROCESSING
o 3. OUTPUT
1.Input – data items enter the computer system and are placed in memory where they can be
processed.
2.Processing- processing data items may involve : organizing or sorting them, checking them for
accuracy, performing calculations.
- The hardware component that performs these type of task is CPU (Central Processing Unit)
3.Output – the operation of retrieving information from memory and sending it to a device.
Programming professionals often use the term data for input items but use the term information for
data that has been processed and output.
Hard drive, flash media or a cloud base device are example of storage devices.
Storage devices are types of hardware equipment such as disk, that holds information for later retrieval
Cloud refers to devices at remote locations accessed through the Internet.
The instructions you write using a programming language are called program code
When you write instructions , you are coding the program.
Rules governing its word usage & punctuation is called language’s syntax.
Mistake in a language’s usage are called syntax errors.
When typing program instructions they are stored in Computer Memory.
Programs that are currently running and data items that are currently be in used are stored in RAM for
quick access.
RAM – is a form of internal, volatile memory. Internal storage is volatile.
Volatile – its content are lost when the computer is turned off or loses power.
Nonvolatile – permanent storage devices, their contents are persistent and are retained even when
power is lost
After a computer program is typed using programming language statements and stored in memory it
must be translated to machine language.
Machine Language – represents the millions of on/off circuits within the computer.
Binary language is represented as a series of 0s and 1s.
Programming language statements are called source code
Translated machine language statements are object code.
Each programming language uses a piece of software.
Compiler or an interpreter used to translate your source code into a machine language.
After a program source code is successfully translated to machine language the computer can
carry out the program instructions.
Runs or Execute a program is to carry out its instructions.
Logical Error – occurs when correct instructions are performed, or when instructions are performed in
the wrong order.
Logic of a computer program is the complete sequence of instructions that lead to a problems solution.
Variable – is a named memory location whose value can vary.
Program Development Cycle – consist of steps that occur during a program’s lifetime.
The Program Development Cycle
1. Understand the problem
2. Plan the Logic
3. Code the program
4. Use software(a compiler or interpreter) to translate the program into machine language
5. Test the program
6. Put the program into production
7. Maintain the program
Write programs to satisfy the needs of others, called users or end users
Documentation – consist of all the supporting paperwork for a program; it might include items such as
original request for the program from users, sample output, descriptions of data items available for
input.
2. Planning the logic
Use sequence of steps or rules you follow to solve a problem – Algorithm
>Planning the logic includes thinking carefully about all the possible data values a program might
encounter and how you want the program to handle each scenario.
The process of walking through a program’s logic on paper before you actually write the program is
called Desk-checking
3.Coding the program
-write the source code to a program, the programmer be concerned with proper punctuation
and correct spelling of commands, using correct syntax
4. Translate the Program into Machine Language - computer understand machine language because
they are made up of thousand of tiny electrical switches, which can be set in either on or off state.
A compiler or interpreter that changes the programmer’s English-like high level programming language
into the low-level machine language that the computer understands.
High-level programming language – supports english like syntax
> Low-level programming language – is made up of 1s & 0s and does not use easily interpreted variable
names.
5. Testing the Program
a program that is free of syntax errors is not necessarily free of logical errors.
The process of finding and correcting program errors called DEBUGGING
6. Putting the program into production
programs is thoroughly tested and debugged, it is ready for organization to use.
7. Maintaining the Program
programs are put into production, making necessary changer is called maintenance
Psuedocode statements are instructions to retrieve an original number from an input device and store in
memory where it can be used in calculation, and then to get the calculated answer from memory and
send it to an output device.
Flowchart Symbols:
Terminal Symbols – indicates the beginning or end of a flowchart segment & is represented by a
lozenge.
Flowlines – connect the steps in a flowchart
Input/Output symbol – represented by a parallelogram in flowcharts.
Processing Symbol – indicates a processing operation and is represented by a rectangle in
flowcharts.
Decision Symbol – is shaped like a diamond and used to represent decisions in flowcharts.
Repeating Instructions
Loop – a repetition of a series of steps
Infinite loop – occurs when repeating logic cannot end.
Using a Sentinel Value to End a Program
Decision Symbol – shaped like a diamond and used to represent decisions in flowcharts
Dummy Value/ Sentinel value – is a preselected value that stops the execution of a program
Understanding Programming User Environment
> Understanding Programming Environment
Text editor – program that you use to create simple text files. It is also a part of an Integrated
Development Environment.
IDE (Integrated Development Environment)
- a software package that provides an editor, compiler and other program tools.
Features of IDE:
- it uses different colors to display various language components, making elements like data types
easier to identify
- It highlights syntax errors visually for you
- It employs automatic statement completion; when you start type a statement.
Command line – location on your computer screen at which you type text entries to communicate
with the computer’s operating system.
Graphical User Interface (GUI) - allows to interact with a program in a graphical environment. The
user might type input into a textbox or use a mouse or other pointing device to select options on the
screen.
Understanding the Evolution of Programming Models
Two major models /paradigms are used by programmer
1.Procedural programming
– focuses on the procedures that programmers create.
2.Object Oriented programming
– focuses on objects, or “things”, and describe their features(also called the attributes) and
behaviors.