0% found this document useful (0 votes)
18 views6 pages

Introduction to Programming and Logic (Chap 1)

Uploaded by

m.jazzz.07
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
18 views6 pages

Introduction to Programming and Logic (Chap 1)

Uploaded by

m.jazzz.07
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 6

What is a Computer?

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.

A computer is not one single device, but a system of


devices that all work together.

cellphones, ipods, blackberries, car navigation systems


and many other devices are computers too.

Serves as the brain of the computer


Program
the CPU chip is usually square with one notched
- Is a set of instructions that a computer follows to corner to help make sure it's properly inserted into
perform a task. the CPU socket.
- are commonly referred to as software. Software is The cpu consist of hundreds of connector pins that
essential to a computer because it controls plug into each of the corresponding holes in the
everything the computer does. All of the software socket.
that we use to make our computers useful is The CPU's main function is to take input from
created by individuals working as programmers or a peripheral (keyboard, mouse, printer, etc) or
software developers. computer program, and interpret what it needs. The
- Examples: Calculator, CPU then either outputs information to your monitor
Microsoft Word (is a word processing program or performs the peripheral's requested task.
that allows you to create, edit, and print
documents with your computer. ), Processor is placed and secured into a compatible CPU
Adobe Photoshop (is an image editing program socket found on the motherboard.
that allows you to work with graphic images, such They produced heat, so they are covered with a heat sink
as photos taken with your digital camera.) to keep them cool and running smoothly.

HOW DOES COMPUTER WORKS?

- A computer is a machine composed of hardware


and software components.
- The input devices of a computer can depend on
the type of computer we are dealing with but
most typically we will find a mouse, keyboard,
scanner or even applications (software) installed
on the computer. Once the data has been Main memory
received, the central processing unit (CPU) along commonly known as random-access memory, or
with the help of other components, takes over RAM.
and processes the information it was given. Once RAM is usually a volatile type of
the data is ready, it will be sent back through an memory that is used only for
output device which can be a monitor, speaker, temporary storage while a program
printer, ports, etc. is running. When the computer is
turned off, the contents of RAM are erased
Major Components Of A Computer System It is called this because the CPU is able to quickly
Central Processing Unit access data stored at any random location in RAM.
Main Memory RAM is usually a volatile type of memory that is used
Secondary Storage Devices only for temporary storage while a program is
Input Devices running. When the computer is turned off, the
Output Devices contents of RAM are erased.
TYPES OF MEMORY: Volatile Memory & Non Volatile
Secondary Storage Device Monitors are similar to TVs but usually display
refers to any non-volatile storage device that is information at a much higher resolution.
internal or external to the computer. Newer monitors usually have LCD (liquid crystal
It can be any storage device beyond the primary display) or LED (light-emitting diode) displays.
storage that enables permanent data storage. These can be made very thin, and they are often
called flat-panel displays. Older monitors
use CRT (cathode ray tube) displays. CRT monitors
are much larger and heavier, and they take up
more desk space

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:

Software Development Tools are the


programs that programmers use to
create, modify, and test software.
Assemblers, compilers, and
2 Commonly Used Applications: Microsoft Word, a word
interpreters are examples of
processing program, and Adobe Photoshop, an image
programs that fall into this category.
editing program. Some other examples of application
Operating system (popularly known as OS) software are spreadsheet programs, email programs, web
most fundamental set of programs on a computer. It is browsers, and game programs.
the software that supports a computer's basic functions,
such as scheduling tasks, executing applications, and
controlling peripherals. PROGRAMMING PLANNING AND DEVELOPMENT
CHAPTER 2

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

Algorithm is a finite list of instructions most often used in


solving problems or performing tasks
Natural language NOT programming language

Characteristics of a Good Algorithm


1. It has input, performs a process, and gives output
2. Must be clear and unambiguous
3. Must correctly solve a problem
Advantages of Using Flowcharts 1. Program Flowchart
 Flowcharts are language independent, it can be It describes graphically the logical sequence of operations
learned and applied without the formal knowledge of and steps within the program
any programming language
 It enforces users to focus more on significant matter 2. System Flowchart
rather than the less significant ones  It describes graphically the operations or
 Being graphically represented, it provides an procedures involved in converting data on input
alternative way to show the usual narrative media to output form
description of the system or programs  It illustrates which data is used or produced at
 Flowcharts are easier to understand than codes various points in a sequence of operations
written in a particular programming languages  It provides the interaction between data,
hardware, and personnel
Disadvantages of Using Flowcharts  The emphasis is given on the media used and the
 Flowchart does not represent a programming work stations through which the data passes
language. It is more of a person-to-person than a  It shows how the components of the system are
person-to-computer way of communications. A used instead of how processing will be
computer cannot accept a program written in accomplished
flowcharting forms
 Remember that thinking in graphics is unusual,
flowcharts should not be viewed as natural means pf
communications
 Certain detailed sequence requires a long sequence CREATE A FLOWCHART FOR CREATING A PEANUT BUTTER
of interconnection symbols which could be easily JELLY SANWICH
written in a few lines of explanation Algorithm
 It does not convey why a given set of operations is 1. Put the bread, peanut butter, jelly, knife, and plate onto
made. Flowcharts only portray how the work space
 It does not highlight the important details since each 2. Place two slices of bread on the plate
3. Using the knife, spread jelly on the other slice
4. If you want jelly, using the knife, spread jelly on the
other slice
5. Slap the two slices of bread, sticky side in
6. Repeat steps 2 through 5 for each additional sandwich
needed
7. Eat the sandwiches

Flowchart

symbol receives as much attention as the others

Kinds of Flowchart

You might also like