Introduction to Programming and Logic (Chap 1)
Introduction to Programming and Logic (Chap 1)
THE CPU
A computer is an electronic machine that accepts (Central Processing Unit)
information (DATA), process it according to specific
instructions. And provide the result as new information.
System Unit is the metal and plastic box that contains the
main components of the computer, including the
motherboard, central processing unit (CPU), and power
supply. The front of the case usually has an On/Off
A computer keyboard is one of the primary input button and one or more optical drives.
devices used with a computer. Similar to an
Different shapes and sizes:
electric typewriter, a keyboard is composed of buttons
desktop case lies flat on a desk, and the monitor
that create letters, numbers, and symbols, as well as
usually sits on top of it.
perform other functions.
tower case is tall and sits next to the monitor or
The mouse is another important tool for communicating on the floor.
with computers. Commonly known as a pointing device, it All-in-one computers come with the internal
lets you point to objects on the screen, click on them, components built into the monitor, which
and move them. eliminates the need for a separate case.
2 main mouse types: optical and mechanical.
The optical mouse uses an electronic eye to detect
movement and is easier to clean. The mechanical
mouse uses a rolling ball to detect movement and
requires regular cleaning to work properly.
Output Device
is any piece of computer hardware equipment which
converts information into human-readable form.
They receive information from the computer, and
carry data that has been processed by
the computer to the user.
Optical Drive is a disc drive that uses laser light and
It can be text, graphics, tactile, audio, and video.
electromagnetic waves within or near the visible light
spectrum as part of the process of reading or writing data
to or from optical discs. (Not common nowadays)
Optical drive allows user to use
DVDs, CDs and blue ray optical
drives.
o Drive contains some
lensed that project
electromagnetic waves
Monitor is a piece of computer hardware that displays that are responsible
the video and graphics information generated by a for reading and wring
connected computer through the computer's video card. data on optical discs.
(The monitor works with a video card, located inside the To write content on a disc, you
computer case, to display images and text on the screen.) need a blank recordable disc. Optical drives write
data to CDs by heating the organic dye later parts For example: if you wanted to install a new video card
of the disc; in the computer, you’d purchase a video expansion
card and install that cad into the compatible
expansion slot.
Hard Disk Drive is the main, and usually largest, data
storage hardware device in a computer. hard disk drive is Port is a physical docking point using which an external
the main, and usually largest, data storage hardware device can be connected to the computer.
device in a computer.
The operating system,
software titles and most
other files are stored in the
hard disk drive.
The hard drive is
sometimes referred to as Types of ports: *Serial port *Parallel Port * PS/2 Port
the “C drive” due to the *Universal Serial Bus *VGA Port *Power Connector
fact that Microsoft Windows, by default, *Firewire Port *Modem Port *Ethernet Port *Game Port
designates the “C” drive letter to the primary *Digital Video Interface, DVI Port *Sockets
partition on the hard drive in a computer.
sometimes called HDD, hard drive, hard disk, fixed Power Supply Unit (Also known as PSU) Converts mains
disk, fixed drive and fixed disk drive. AC to low-voltage regulated DC power for the internal
Popular hard drive manufacturers include components of a computer.
Seagate, Western Digital, Hitachi, and Toshiba
Some power supplies have
Motherboard is the main printed circuit board found in a manual switch for
general purpose computers and other expandabl e selecting input voltage,
systems. while others automatically
(Alternatively referred as mainboard, mobo, system adapt to the mains voltage.
board, main circuit board) The power supply unit is the piece of hardware that
converts the power provided from the outlet into
It holds, and allows,
usable power for the many parts inside the computer
communication between
case. It converts the alternating current from your
many of the crucial
wall outlet into a continuous form of power called
electronics components of
direct current that the computer components require.
a system.
MOBO is a printed circuit
board and foundation of a computer that us the
biggest board in a computer chassis. Software is a set of instructions, data or programs used to
Mobo allows all the parts of your computer to receive operate computers and execute specific tasks.
power and communicate with one another. Software is a generic term used to refer to applications,
Expansion Slot is a socket on the motherboard that is scripts and programs that run on a device.
used to insert an expansion card (or circuit board), which Computer software, or simply software, is a collection of
provides additional features to a computer such as video, data or computer instructions that tell the computer how
sound, advanced graphics, Ethernet or memory. to work.
(Alternatively known as bus slot, expansion port.)
If a computer is to function, software is not optional.
Provides an Everything that a computer does, from the time you turn
installation point for a the power switch on until you shut the system down, is
hardware expansion under the control of software.
card to be connected.
Can be found on the There are 2 General Categories Of Software: system
motherboard. software and application software.
System Software A utility program performs a specialized task that
Programs that control and enhances the computer’s operation or safeguards data.
manage the basic Examples of utility programs are virus scanners, file
operations of a computer are compression programs, and data backup programs.
generally referred to as
system software. It is a type of computer program that is Application Software
designed to run a computer’s hardware and application Programs that make a computer useful for everyday tasks
programs. are known as application software. These are the
programs that people normally spend most of their time
System software typically includes the following types of running on their computers
programs:
COMPUTER PROGRAMMING
It involves writing instructions telling the computer
how to process a specific information.
Computer programs are written to solve particular
The operating system controls the internal operations of problems.
the computer’s hardware, manages all of the devices Computer programming is like solving mathematical
connected to the computer, allows data to be saved to equations.
and retrieved from storage devices, and allows other
programs to run on the computer.
Utility Program performs a specialized task that enhances Basic Steps in Problem Solving:
the computer’s operation or safeguards data. Examples of 1. Analyze the problem and develop the specification
utility programs are virus scanners, file compression Programmers must completely understand and
programs, and data backup programs. write precise statement of the problem;
The programmer should be able to answer each
of the following questions to fully understand the
problem;
1.1 What are the inputs to the problems? What is known?
Given? And in what form?
1.2 What are the desired outputs? What kind of
information is needed at the end?
1.3 What are the processing steps necessary to go from
the known given to the desired output?
2. Design a solution 4. Can be followed with paper and pencil
This involves writing particular steps to correctly 5. Must execute in a finite number of steps
and best solve the problem
This is the outline where the codes will be written
The solution must be complete and effective
Test the steps repeatedly to make sure that the
outlined solutions effectively solve the problem
These steps should be:
Unambiguous
Detailed and finite
Finished in a series of steps
3. Code the program in a programming language with
documentation
Translate the steps into known programming
language
Program writing follows the steps developed in
step 2
A completely written solution dictates the time a
programmer needs to code the program
A good programmer provides “documentation” to
his written code
Documentation comes in comments explaining
how a line or block of code works
PSEUDOCODE
Embedded comments help in debugging the
It is a methodology that allows the programmer to
program during the testing and validation period
represent the implementation of an algorithm.
4. Test the program
Pseudo code, as the name suggests, is a false code or
Programmers should test every portion of the
a representation of code which can be understood by
program
even a layman with some school level programming
Remember to test each part of the program to
knowledge.
make debugging an easy task
5. Validate the program
PSEUDOCODE WITH ALGORITHM
After the program had been written and tested, it
should be validated by extensive testing FLOWCHART
Create a block of test scenarios or materials to Visual program design tool.
effectively validate that the program will run in Symbols describe operations to be performed
every possible scenarios Flowcharts use special shapes to represent different
It is also where program’s user interface is types of actions or steps in a process.
examined, test whether the directions are Lines and arrows show the sequence of the steps, and
sufficient, how the program handles invalid inputs the relationships among them. These are known as
Remember that extensive testing of the program flowchart symbols.
in every possible situation is necessary before it
can be considered complete
Flowchart
Kinds of Flowchart