Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Introduction: Fundamentals of Programming

PROGRAMMING PROCESS AND CONCEPTS

Introduction

A computer is a system made of two major components: hardware and software. Computer hardware is the physical
equipment. The software is the collection of programs (instructions) that allow the hardware to do its job. The
hardware component of the computer system consists of five parts: input devices, central processing unit (CPU), primary
storage, output devices, and auxiliary storage devices.

Computer Software
Computer Software is divided into two broad categories: system software and application software.

1. System Software

System Software consists of programs that manage the hardware resources of a computer and perform required
information processing task. These programs are divided into three classes: the operating system, system support,
and system development.
 The operating system provides services such as user interface, file and database access, and interfaces to
communication systems such as Internet protocols. The primary purpose of this software is to keep the
system operating in an efficient manner while allowing the users access to the system.
 System support software provides system utilities and other operating services. Examples of system utilities
are sort programs and disk format programs.
 System development software includes the language translators that convert programs into machine
language for execution, debugging tools to ensure that the programs are error-free, and computer-assisted
software engineering (CASE) systems.

2. Application Software

Application Software is broken into two classes: general-purpose software and application-specific software.
 General-Purpose software is purchased from a software developer and can be used for more than one
application.
 Application-specific software can be used only for its intended purpose.

Computing Environments
a) Personal Computing Environment
b) Time Sharing Environment
c) Client/Server Environment
d) Distributed Computing

ICT 103: Fundamental of Programming 1 (Java Programming)

The Computer Level Hierarchy

 Each virtual machine layer is an abstraction of the level below


it.
 The machines at each level execute their own particular
instructions, calling upon machines at lower levels to perform
tasks as required.
 Computer circuits ultimately carry out the work.

Level 6: The User Level – Program execution and user interface level.
– The level with which we are most familiar.

Level 5: High-Level Language Level – The level with which we interact


when we write programs in languages such as C, Pascal, Lisp, and Java.
1
Introduction: Fundamentals of Programming

Level 4: Assembly Language Level – Acts upon assembly language produced from Level 5, as well as instructions
programmed directly at this level.

Level 3: System Software Level – Controls executing processes on the system.


– Protects system resources
– Assembly language instructions often pass through Level 3 without modification.

Level 2: Machine Level – Also known as the Instruction Set Architecture (ISA) Level.
– Consists of instructions that are particular to the architecture of the machine.
– Programs written in machine language need no compilers, interpreters, or assemblers.

Level 1: Control Level – A control unit decodes and executes instructions and moves data through the system.
– Control units can be microprogrammed or hardwired.
– A microprogram is a program written in a low level language that is implemented by the hardware.
– Hardwired control units consist of hardware that directly executes machine instructions.

Level 0: Digital Logic Level – This level is where we find digital circuits (the chips).
– Digital circuits consist of gates and wires.
– These components implement the mathematical logic of all other levels

PROGRAMMING LANGUAGE: This refers to application software used to write a program for a special purpose:
- Scientific Applications
- Business Applications
- Artificial intelligence
- Web Software Applications
- Special Purpose Applications
- System Programming Application
- Overall Advancement of Computing

- PROGRAM: Se t of ins t ruct i ons w hic h t he comput e r w il l f ol low t o s olv e a p rob le m


- A LG O RI T HM : A ste p b y st e p procedure th a t a ccom pli she s a de si red t a sk.

CLASSIFICATION OF PROGRAMMING LANGUAGES

- Computer language is use to write a program for a computer.

Machine Language Symbolic Language High-Level Language

1940’s 1950’’s 1960’s

1. Machine Language
The only language understood by computer hardware. In the earliest days of computers, the only programming
languages available were machine languages. Each computer has its own machine language, which is made of
streams of 0’s and 1’s.
ICT 103: Fundamental of Programming 1 (Java Programming)
2. Symbolic Languages
Symbolic language uses symbols, or mnemonics, to represent the various machine language instructions. Because a
computer does not understand symbolic language, it must be translated to the machine language. A special program
called an assembler translates symbolic code into machine language, they soon became known as assembly
languages.

3. High-Level Languages
High-level languages are designed to relieve the programmer from the details of the assembly language. High-Level
languages share one thing with symbolic languages, however: they must be converted to machine language, the
process of converting them is known as compilation.

The first high level language is FORTRAN, was created by John Backus and an IBM team in 1957; it is still widely
used today in scientific and engineering application. Following the FORTRAN was COBOL by Admiral Hopper was
again a key figure in the development of the COBOL business language.

DESCRIBING SYNTAX AND SEMANTICS

Language – are sets of string of characters from the alphabets.


Sentence – sets of language.
In general, sequences of legal tokens don't always form legal program phrases, just as in English. The rules that
determine which sequences of tokens are legal program phrases are called a grammar. The act of applying the rules of a
grammar to determine which sequence of tokens is legal, and of classifying these groups, is called parsing.
2
Introduction: Fundamentals of Programming

A lexeme is the minimal unit of language which has a semantic interpretation and embodies a distinct cultural concept. It
is made up of one or more form-meaning composites called lexical units. A lexical database is organized around
lexemes, which include all the morphemes of a language, even if these morphemes never occur alone. A lexeme is
conventionally listed in a dictionary as a separate entry.

A lexical unit is a form-meaning composite that represents a lexical form, and single meaning of a lexeme. Also
known as: sense . A lexical form is an abstract unit representing a set of wordforms differing only in inflection
and not in core meaning. It is a component part of a lexical unit.
Examples (English)

The lexeme, brooch n. 'a large ornamental pin with a clasp, worn by women' has a single lexical unit with a single
lexical form representing the two wordforms, brooch and brooches. The primary senses of the lexeme ignite. 'To set fire
to' is a single lexical unit with a single lexical form representing several wordforms such as, ignite, ignited, ignites and
igniting.

Syntax – refers to a form of its expression statement and program unit.


Semantics- are the meaning of expressions statements and program unit.
Token - Individual words and punctuation words are called Tokens which considered as a category of lexemes.
Keyword:
- C word is classified as either a key word or identifier.
- All keywords have fixed meaning and meaning cannot be changed.
- It serves as a basic building block of program statement.
- All keywords must be written in lower case.
Identifiers:
- It refers to the names of variables, functions and arrays
- These are user defined name and consist of sequence of letters and digits as first characters
- Both upper and lower cases are permitted
- Underscore (_ ) character is allowed in identifier. It is usual used as a link between two words in long identifier.

Constants:
The value of the constants does not change during the execution of the program.
Ex. index = 2 * count + 17;

Lexemes Tokens
Index identifier
= equal sign
2 Literal
* Operator
count identifier
+ Operator
17 literal
; Semicolon

Program Development ICT 103: Fundamental of Programming 1 (Java Programming)


Program Development is a multiple process that requires that we understand the problem, develop a solution, write
the program and then test it.
1. Understand the problem
2. Develop a solution
a) Structure Charts: A structure chart, also known as a hierarchy chart, shows the fundamental flow through
our program.
b) Pseudocode is part English, part program logic. Its purpose is to describe, in precise algorithmic detail, what
the program being designed is to do. It is English-like statements that follow loosely defined syntax and are
used to convey the design of an algorithm.

c)Flowcharts: Design tool in which standard graphical symbols are used to represent the logical flow of data
through a function.
3. Write the program
4. Test the program

A. Jobs of the Programmer


- Get the information into the program
- Arrange for some place to keep it
- Give the instructions to manipulate it
- Get it back out of the program user

B. Why you should organize your instruction in your program?


- Some are executed only when a specific condition (or self-conditions) is true.
3
Introduction: Fundamentals of Programming

- Some are repeated a number of times.


- Some are broken into chunks that can be executed at different locations in your program.

SEVEN BASIC ELEMENTS OF PROGRAMMING


1. Inputs - Get the information into the program
2. Data Types - Arrange for some place to keep it
3. Operations - Give the instructions to manipulate it
4. Output - Get it back out of the program user
5. Conditional execution - Some are executed only when a specific condition (or self-conditions) is true.
6. Loops - Some are repeated a number of times.
7. Subroutines - Some are broken into chunks that can be executed at different locations in your program.

PROGRAMMING IMPLEMENTATIONS METHODS

 PURE INTERPRETATION
o No translation before execution
o Slow execution
o Loop statements are repeatedly translated
o Becoming rare except for web scripting languages
o Example: Some LISP implementations, Unix shell scripts and Web server scripts

 COMPILATION
o Translates a high-level program to machine code
o Slow translation
o Fast execution
o Separate compilation units must be
o combined by a linker into an executable image (.exe file)

 HYBRID IMPLEMENTATION SYSTEMS


o Translates a high-level language to intermediate code
o Each statement is translated only once in contrast to pure interpretation
o Medium execution speed
o Smalltalk and Java
 Intermediate code is called bytecode
 The interpreter is the JVM
o JIT technology now widely used with Java and .NET

Text Editor #include….


Source

Programmer
Compiler 00110100 Object
01100010
ICT 103: Fundamental of Programming 1 (Java Programming)

Linker 00110100 00001100


0110001000001110 Executable

Library

Runner ___ __ _ Results


___ __ _

PROGRAMMING ENVIRONMENTS
The collection of tools used in software development :
o File system, text editor, compiler, linker
o Borland JBuilder : An integrated development environment for Java and C

Microsoft Visual Studio.NET


o A large, complex visual environment
o Used to program in C#, Visual BASIC.NET, Jscript, J#, and C++

You might also like