1
,Contents
Understanding Computer Systems ............................................................................ 4
Hardware ................................................................................................................ 4
Software ................................................................................................................. 4
Input........................................................................................................................ 5
Data items .............................................................................................................. 5
Processing .............................................................................................................. 5
Output ..................................................................................................................... 5
Programming .............................................................................................................. 5
➢ Machine language ............................................................................................ 6
➢ Syntax errors .................................................................................................... 6
Understanding Programming Logic ............................................................................ 7
Program Development Cycle ..................................................................................... 9
Understanding the problem .................................................................................... 9
Planning the logic ................................................................................................... 9
Coding the program ................................................................................................ 9
Using Software ....................................................................................................... 9
Testing the Program ............................................................................................... 9
Putting the Program into Production ....................................................................... 9
Maintaining the Program ....................................................................................... 10
Pseudocode and Flowcharts .................................................................................... 11
Writing Pseudocode ................................................................................................. 11
Drawing Flowcharts .................................................................................................. 11
Flowchart Symbols ................................................................................................... 12
Sentinel Value to End a Program ............................................................................. 12
Practice Test ............................................................................................................ 13
Data types, variables and constants......................................................................... 18
❖ Numeric ....................................................................................................... 18
❖ String ........................................................................................................... 18
Unnamed, Literal Constants ..................................................................................... 18
Understanding a Declaration’s Data Type ................................................................ 19
❖ A numeric variable ...................................................................................... 19
❖ A string variable .......................................................................................... 19
Rules to naming a variable ....................................................................................... 19
Assigning Values to Variables .................................................................................. 20
2
,Initializing a Variable ................................................................................................ 21
Where to Declare Variables ..................................................................................... 21
Declaring Named Constants .................................................................................... 21
Practice test ............................................................................................................. 23
Performing Arithmetic Operations ............................................................................ 24
Advantages of Modularization .................................................................................. 26
Hierarchy Charts ...................................................................................................... 27
Features of Good Program Design........................................................................... 28
Choosing Identifiers.................................................................................................. 28
Maintaining Good Programming Habits.................................................................... 29
3
, Understanding Computer Systems
A computer system is a combination of all the components required to process and
store data using a computer.
Every computer system is composed of multiple pieces of hardware and software.
Hardware is the equipment, or
the physical devices, associated
with a computer. For example,
keyboards, mice, speakers, and
printers are all hardware. The
devices are manufactured
differently for computers of varying
sizes—for example, large
mainframes, laptops, and very
small devices embedded into
products such as telephones, cars,
and thermostats. The types of
operations performed by different
sized computers, however, are very
similar.
Software is computer instructions
that tells the hardware what to do.
Software is programs, which are
instruction sets written by
programmers. You can buy
prewritten programs that are stored
on a disk or that you download from
the Web. For example, businesses
use word processing and accounting
programs, and casual computer
users enjoy programs that play music
and games.
Software can be classified into two broad types:
➢ Application software comprises all the programs you apply to a task, such as
word processing programs, spreadsheets, payroll and inventory programs,
and games..
➢ System software comprises the programs that you use to manage your
computer, including operating systems such as Windows, Linux, or UNIX for
larger computers and Google Android and Apple iOS for smartphones.
4
,Contents
Understanding Computer Systems ............................................................................ 4
Hardware ................................................................................................................ 4
Software ................................................................................................................. 4
Input........................................................................................................................ 5
Data items .............................................................................................................. 5
Processing .............................................................................................................. 5
Output ..................................................................................................................... 5
Programming .............................................................................................................. 5
➢ Machine language ............................................................................................ 6
➢ Syntax errors .................................................................................................... 6
Understanding Programming Logic ............................................................................ 7
Program Development Cycle ..................................................................................... 9
Understanding the problem .................................................................................... 9
Planning the logic ................................................................................................... 9
Coding the program ................................................................................................ 9
Using Software ....................................................................................................... 9
Testing the Program ............................................................................................... 9
Putting the Program into Production ....................................................................... 9
Maintaining the Program ....................................................................................... 10
Pseudocode and Flowcharts .................................................................................... 11
Writing Pseudocode ................................................................................................. 11
Drawing Flowcharts .................................................................................................. 11
Flowchart Symbols ................................................................................................... 12
Sentinel Value to End a Program ............................................................................. 12
Practice Test ............................................................................................................ 13
Data types, variables and constants......................................................................... 18
❖ Numeric ....................................................................................................... 18
❖ String ........................................................................................................... 18
Unnamed, Literal Constants ..................................................................................... 18
Understanding a Declaration’s Data Type ................................................................ 19
❖ A numeric variable ...................................................................................... 19
❖ A string variable .......................................................................................... 19
Rules to naming a variable ....................................................................................... 19
Assigning Values to Variables .................................................................................. 20
2
,Initializing a Variable ................................................................................................ 21
Where to Declare Variables ..................................................................................... 21
Declaring Named Constants .................................................................................... 21
Practice test ............................................................................................................. 23
Performing Arithmetic Operations ............................................................................ 24
Advantages of Modularization .................................................................................. 26
Hierarchy Charts ...................................................................................................... 27
Features of Good Program Design........................................................................... 28
Choosing Identifiers.................................................................................................. 28
Maintaining Good Programming Habits.................................................................... 29
3
, Understanding Computer Systems
A computer system is a combination of all the components required to process and
store data using a computer.
Every computer system is composed of multiple pieces of hardware and software.
Hardware is the equipment, or
the physical devices, associated
with a computer. For example,
keyboards, mice, speakers, and
printers are all hardware. The
devices are manufactured
differently for computers of varying
sizes—for example, large
mainframes, laptops, and very
small devices embedded into
products such as telephones, cars,
and thermostats. The types of
operations performed by different
sized computers, however, are very
similar.
Software is computer instructions
that tells the hardware what to do.
Software is programs, which are
instruction sets written by
programmers. You can buy
prewritten programs that are stored
on a disk or that you download from
the Web. For example, businesses
use word processing and accounting
programs, and casual computer
users enjoy programs that play music
and games.
Software can be classified into two broad types:
➢ Application software comprises all the programs you apply to a task, such as
word processing programs, spreadsheets, payroll and inventory programs,
and games..
➢ System software comprises the programs that you use to manage your
computer, including operating systems such as Windows, Linux, or UNIX for
larger computers and Google Android and Apple iOS for smartphones.
4