An Introduction To Java Programming
An Introduction To Java Programming
Programming
• An Introduction to Java Programming
Grab a Bag
I am ___________.
I always bring along with me a/an _______
because _______________________.
INTRODUCTION TO
PROGRAMMING CONCEPTS
• What is a Computer?
• Basic Components of a Computer
• Hardware Concepts
• Number Systems and Conversions
• Software Concepts
• Software Development Life Cycle (SDLC)
WHAT IS A
COMPUTER?
anelectronic device that performs a variety of task
according to specific instructions.
a data processing machine that accepts input information,
processes it according to a list of internally stored
instructions called a program, and produces the resultant
output information
Program
a set of instructions telling a computer what to do
Programming
the craft of implementing one or more interrelated abstract
algorithms using a particular programming language to
produce a concrete computer program
COMPONENTS OF A COMPUTER
Hardware
the physical equipment of a computer system,
including the monitor, keyboard, central processing
unit, and storage devices
Software
refers to one or more computer programs and data
held in the storage of a computer for some purpose
HARDWARE CONCEPTS
Data representation
conversion of images, letters and sounds into
electrical signals
Digital electronics
manipulation of “on” and “off” signals to perform
complex tasks
HARDWARE CONCEPTS
Digital device
works with discrete signals, such as 0 and 1
Analog device
works with continuous data
Digital data representation
How can a computer represent numbers using
bits?
“0” and “1” are also known as bits or binary digits
The computer uses the binary number system
which uses only two digits: 0 and 1.
A series of 0’s and 1’s results in a particular number
much in the same way we use the decimal number
system
Digital Data representation
Decimal (Base 10) Binary Base 2
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
Digital Data representation
A closer look on bits:
Example A:
Derive the decimal value of 6409
Solution:
6409 = 0 x 90 + 4 x 91 + 6 x 92
=0x1+4x9+6x9x9
= 0 + 36 + 486
= 52210
NUMBER SYSTEM CONCEPTS
Example B:
Derive the decimal value of 64012
Solution:
64012 = 0 x 120 + 4 x 121 + 6 x 122
= 0 x 1 + 4 x 12 + 6 x 12 x 12
= 0 + 48 + 864
= 91210
NUMBER SYSTEM CONCEPTS
Example C:
Derive the decimal value of 64016
Solution:
64016 = i=1∑i=3 pi 16(i-1)
= 0 x 160 + 4 X 161 + 6 X 162
= 0 + 64 + 1536
= 1600
DIGITS IN A NUMBER SYSTEM
Hexadecimal, Octal, & Binary Systems
Example A:
Derive the decimal value of 110111012
Solution:
110111012 = 1 x 20 + 0 x 21 + 1 x 22
+ 1 x 23 + 1 x 24 + 0 x 25
+ 1 x 26 + 1 x 27
Value = 1 + 0 + 4 + 8 + 16 + 0 + 64 + 128
= 22110
DIGITS IN A NUMBER SYSTEM
Example B:
Derive the decimal value of 541760238
Solution:
541760238 = 3 x 80 + 2 x 81 + 0 x 82
+ 6 x 83 + 7 x 84 + 1 x 85
+ 4 x 86 + 5 x 87
Value = 3 + 16 + 0 + 3072 + 28672
+ 32768 + 1048576 + 10485760
= 1159886710
DIGITS IN A NUMBER SYSTEM
Example C:
Derive the decimal value of 24CF16
Solution:
24CF16 = F x 160 + C x 161 + 4 x 162 + 2 x 163
Solution:
a. Convert 10112 to decimal:
10112 = 1 x 20 + 1 x 21 + 0 x 22 + 1 x 23
decimal value = 1 + 2 + 0 + 8 = 1110
OPERATIONS AND CONVERSIONS OF
NUMBER SYSTEMS
Example B: (Alternative Method)
Derive the octal value of 101110112
Solution:
Group the binary digits into three:
101110112 = 10 111 0112 = 010 111 0112
421
Now, 0 1 0 = 2
421
111=7
421
011=3
Therefore,
010 111 0112 = 2738
OPERATIONS AND CONVERSIONS OF
NUMBER SYSTEMS
Example C: (Alternative Method)
Derive the hexadecimal value of 10111011
2
Solution:
Group the binary digits into four:
101110112 = 1011 10112
8421
Now, 1 0 1 1 = 11
8421
1 0 1 1 = 11
But 1116 = B; therefore,
101110112 = BB16
Digital Data representation
ASCII
American Standard Code for Information Interchange
requires only seven bits for each character
EBCDIC
Extended Binary Coded Decimal Interchange Code
an alternative 8-bit code used by older IBM mainframe computers
UNICODE
uses 8, 16, or 32 bits providing codes for 65,000 characters (represent the
alphabets of multiple languages) and becoming popular
Digital Data representation
BYTE
a collection of bits (8 bits)
abbreviated as an uppercase “B”
DIGITAL ELECTRONICS
How are bits stored and transferred from
one point to another?
Since most computers are electronic devices,
bits take the form of electrical pulses
traveling over the circuits. All circuits, chips,
and mechanical components forming a
computer are designed to work with bits.
DIGITAL ELECTRONICS
Basic parts of a computer
Processor
or CPU
Input Output
Devices Devices
Computer
Memory
DIGITAL ELECTRONICS
Input devices
are machines that generate input for the computer, such as
keyboard and mouse.
Processor or CPU (Central Processing Unit)
is the central electronic chip that controls the processes in the
computer
determines the processing power of the computer
Output devices
are machines that display information from the computer, such as
monitor, speaker, and printer
Memory
is the part of the computer that stores applications, documents,
and systems operating information
SOFTWARE CONCEPTS
What is a software?
computer instructions or data
anything that can be stored electronically
computer programs, modules (support and data) working together
providing computers with instructions and data for certain task (e.g.
word processing, internet browsing)
SOFTWARE BASICS
Data vs. Software
Before, the term “software” is always associated to
all non-hardware components of a computer.
However, modern definitions made it clear that all
documents, spreadsheets and even downloaded
materials from the net are now classified as data.
SOFTWARE BASICS
Source code
Code written by the programmer
Object code
machine language representation of the source code
Linker
creates the executable code
combines program object code, object code from library
routines and any other required system code into one
addressable machine language file
SOFTWARE BASICS
Application Software vs. System Software
Application software
are computer programs that are used to accomplish specific or
specialized tasks for computer users
System software
helps the computer carry out its basic operating functions.
SOFTWARE BASICS
Computer User
Application
Software
(Microsoft Word)
application software
makes a request to the
system software to print
the document
System Software
(Operating System,
Device Drivers)
Hardware
(Computer, Printer)
SOFTWARE DEVELOPMENT LIFE
CYCLE
Software Development Life Cycle
a methodology that is typically used to develop, maintain, and
replace information systems for improving the quality of the
software design and development process
Importance of SDLC
In order to create systems that are good in design
It serves as a guide in systems development
SOFTWARE DEVELOPMENT LIFE
CYCLE
Five phases of SDLC
Planning
Analysis
Design
Implementation
Maintenance
SOFTWARE DEVELOPMENT LIFE
CYCLE
Planning Phase
the initial stage in the SDLC that has to be
performed
includes the information about the requirements for
the proposed software
known as the feasibility study phase
Maintenance Phase
Waterfall SDLC
Suggests that prior to proceeding to next phase, the
current phase should be finished first.
Planning
Analysis
Design
Implementation
Maintenance
SOFTWARE DEVELOPMENT LIFE
CYCLE
Modified waterfall
allows overlap between phases
PLANNING
ANALYSIS
DESIGN
IMPLEMENTATION
MAINTENANCE
Iterative SDLC
allows phases to repeat, if necessary
ANALYZE ANALYZE
PLANNING DESIGN DESIGN MAINTAIN SYSTEM
IMPLEMENT IMPLEMENT
Introduction to
Programming
• An Introduction to Java Programming