You are on page 1of 15

Software categories

 Software is categorized into two classes


❑ System software
❑ Application software
Operating system is the core software of a computer.
Performs two main functions
➢ Providing the user interface that allows the user to
interact with the machine
➢ Manages the computer resources such as the
processor and the memory
Give examples of operating systems
Application programs
 Application: a generic term for any software other than
the operating system.
 Examples: word processor, database managers, web
browser, computer games etc.
 Each application program has its own user interface
that allows the user to interact with that particular
program.
Introduction to programming
 Computer programs: instructions for a computer
 A computer requires programs itself to function and
accomplish other user related tasks.
 The program has an executable form that a computer
can use directly to execute instructions.
 Computer programming or coding is the process of
writing, testing, debugging (troubleshooting) and
maintaining the source code of computer programs.
 Programmer: someone who write computer programs
(software).
Programming languages
 Programming language: an artificial language designed to
express computations that can be performed by a machine,
mainly a computer. It is used to create programs that control the
behavior of a computer.
 Examples include C, C++, Java, PHP, Visual basic etc
 This languages come in two levels:
❑ Low level programming languages: they communicate with
the computer hardware directly. They are hard to
understand. They include
➢ Machine languages
➢ Assembly languages
❑ High level programming languages: are more English-like.
They were made to simplify low level languages.
Machine language
 Also known as machine code or object code.
 Is the “native tongue” of a computer, the language the
computer hardware understands.
 Each unique computer has a unique machine language.
 A machine language program is made up of a series of
binary patterns (e.g., 01011100) which represent simple
operations that can be accomplished by a computer (e.g.
add two operands, move data to memory location)
 Machine language programs are executable, meaning that
they can be run directly.
 Programming in machine language requires memorization
of the binary codes and can be difficult to a programmer.
Assembly language
 Assembly language represents an effort to make
programming easier for humans.
 The machine level instructions are replaced with
simple pneumonic abbreviations (e.g. ADD, MOV)
 Are unique to a specific computer (machine).
 Prior to execution, an assembly language program
requires translation to a machine language. This
translation is accomplished by a computer program
known as an assembler.
 Assemblers are written for each unique machine
language.
High level languages
 Are more English-like. They make it easier for
programmers to “think” in the programming language.
 Require translation to machine language before
execution. This translation is accomplished by either a
compiler or an interpreter.
 Compilers translate the entire source code program
before execution
 Interpreters translate source code programs one line
at a time. Interpreters are more interactive than
compilers.
Reading exercise

 High level languages have been classified into


generations. Define third-generation, fourth-
generation and fifth generation programming
languages.
Syntax and semantics
 Programming language has syntax and semantics.
 Syntax: specifies the string of symbols that are legal
programs. They are the rules governing the formation of
valid statements in a programming language.
 Semantics: specifies the meaning of each syntactic
structure and the action to be taken when that structure is
encountered.
 Example
 The string of characters “3+5” might be a syntactically legal
program segment. This string uses numerals “3” and “5”
and a plus sign. Semantically, it might assert that the
operation addition is to be performed on the integers 3 and
5
debugging
 A bug is a fault or a defect or an error in a computer
program, system or machine. The process of
identifying and correcting a computer program error is
called debugging. There are three kinds of errors that
are likely to occur during program development:
− Logical/semantic errors
− Compiler errors
− Runtime errors
Compiler error
 Prevents your program from running
 Most compiler errors are caused by mistakes that you
make while typing code e.g. you might misspell a
keyword, leave out some necessary punctuation or try
to use an End if statement without first using an if
statement.
Run-time errors
 They occur while your program runs. These typically
occurs when your program attempts an operation that
is impossible to carry out.
 An example of these is division by zero. Suppose you
had the following statement:
Speed = miles/hours
If the variable “hours” has a value zero, the division
operations fails and causes a run time error. The
program must run in order to be detected, and if Hours
contains a valid value, it will not occur at all.
Logical error
 These are errors that prevent your program from doing
what you intended it to do.
 Your code may compile and run without error, but the
result of the operation may produce a result that you did
not expect e.g. you might have a variable named FirstName
that is initially set to a blank string. Later in the program,
you might concatenate FirstName with another variable
named LastName to display a full name. if you forgot to
assign a value to FirstName, only the last name would be
displayed, not the full name as you intended.
 These type of errors are the hardest to detect and fix.
Summary
 Computer components i.e. hardware and software
 Software is classified into system and application
software
 Programming languages – levels, compilers and
interpreters, syntax and semantics
 Debugging-run-time, compile-time and logical errors.
 End

You might also like