Computer Software


Introduction to Computer Software

Unit-4


Computer has no use without software. Software is a part of computer, which processes data & give the information. The computer would be just a useless metallic box if there were no software. Computer software comes in following forms:
      System Software
      Application Software
      Utility Software

1. System Software

The system software consists of computer programs, which facilities the operation of computer by the user installation. The software, which contributes to the control of the computer system, is called as system software. The sub division of system software is as follows: Operating Systems, Translators like Assemblers, Interpreters, Compilers, & Programming languages. System software refers to general programs designed for performing tasks such as controlling all operations required to move data into and out of the computer. It communicates with printers, card reader, Disks, and tapes etc. It monitors the use of hardware like memory, CPU, etc. System software allows application packages to be run on the computer with less time and effort. Remember that it is not possible to run application software without system software. The development of system software is a complex task and it requires extensive knowledge of computer technology. Due to its complexity it is not developed in house. Computer manufactures build and supply this system software with the computer system. DOS, UNIX and WINDOWS are some of the widely used system software.


2. Application Software

Application software is the set of programs designed to satisfy user's specific neaeds. Although application software packages differ in their use of specific commands and functions, most of them have some features in common: cursors, scrolling, menus, pull down menu, help screens, dialog boxes and tutorial and documentation. For example: Word
Processing software, Spreadsheet software, DBMS software, Graphic software, Multimedia software, Communication software, and integrated software.

a. Word processing software

Word processing software allows us to use computers to create, edit, revise, store and print documents. It enables the user to easily insert, delete, and move words, sentences and paragraphs. Word-processing programs also offer a number of features for “dressing up” document with variable margins, type sizes and styles. The user can do all these manipulations on screen before printing out hard copy. Some word processing packages, including WordPerfect, Microsoft Word, and Ami-Pro provide desktop- publishing features that enable users to integrate or combine graphics and text on a professional looking page.



b. Desktop Publishing Software

Desktop publishing abbreviated DTP, involves using microcomputer and mouse, scanner, laser printer and DTP software for mixing text and graphics to produce high quality printed output. Principal desktop publishing programs are Adobe PageMaker, Quark Xpress and First publisher.

c. Electronic spreadsheet software

The electronic spreadsheet allows users to create tables and financial schedules by entering data into rows and columns arranged as a grid on a display screen. Its automatic calculation abilities can save the user almost a lifetime of tedious arithmetic. Spreadsheet can also display data in graphic form, such as in pie charts or bar charts. Today the principal spreadsheets are Excel, Lotus1-2-3 and Quattro Pro.

d. Database Management system software

Database management system (DBMS) software consists of programs for storing, indexing, retrieving and manipulating large amount of data. With database management system software, we can compile huge amounts of data and manipulate, store and retrieve it without having to touch a single file.

e. Graphics Software

Graphics software enables users to produce many types of graphics creations, which come in two forms:

              Analytical graphics: Analytical graphics are basic graphical forms used to make numerical data easier to understand. The most common analytical graphics forms are bar graphs, line charts, and pie charts –or a combination of these forms. Most analytical graphics programs come as part of spreadsheet packages.

              Presentation graphics: Presentation graphics are graphics used to communicate or make a presentation of data to others such as clients or supervisors. Presentations may make use of analytical graphics, but they look much more sophisticated. Examples of well-known graphics packages are Photoshop, paintbrush, Hollywood (film editing software), Freelance plus etc.

f. Multimedia software

Multimedia software is able to manipulate elements of text, graphics, sound, video and animation. All these elements may be pulled together and presented for instructional or entertainment purposed such as a history of the exploration of the moon or a biography of a particular musical composer.

g. Communication Software

Communication software includes programs that access software and data from, and transmit data to, a computer in a remote location. Popular microcomputer communications programs include smart com, Crosstalk, ProComm, Pc-Dial and PC Talk.

h. Integrated software

It is a collection of several applications in a single package with a common set of commands and the ability to work together and share data. The objective is to allow the user to perform a variety of tasks without having to switch software programs and learn different commands and procedures to run each one. Integrated software combines the basic capabilities of word processing, electronic spreadsheet, graphics, DBMS, and data communication.

3. Utility Software

Utility software generally used to support existing programs in a computer system. Many operating systems have utility software built in for common purposes such as copying the content of one disk to another to recover damaged files etc. Most common examples of utility software are:

a.    Defragmentation:
A file that is split up on the disk is called as fragmented because its parts are physically separated. The problem with fragmented files is that it takes the hard drive longer to read &write them because the disk must reposition its R/W heads several times while working with the same files. A utility program that defragments files on a disk can speed up the disk drive.
b.    Data compression:
Data compression is the ability to reduce the storage requirements of a file using mathematical algorithms. This facility is generally provided with communication. Data compression techniques are built with modems so they can send files faster. Examples: PKZIP, WINZIP etc.
c.    Backup software:
Backup software is designed to help us to copy large group of files from our hard disk to some other storage media such as diskettes, magnetic tape, record able CDs etc.
d.    Data recovery software:
Data recovery utility can recover data files that have been mistakenly deleted. Trash for Mac & Recycle Bin for windows O.S. is its examples.
e.    Antivirus Utilities:
Tracking viruses down, eradicating them & preventing their spread are the major objectives of anti-virus utilities. Examples: Symantec Antivirus, Norton Antivirus etc.

Operating System

An operating system is a collection of programs that controls the overall operation of the computer system. Operating system controls and co-ordinates the use of the hardware among the various application programs for the various users. So it acts as an interface or platform between the user and the computer hardware.

An operating system manages and coordinates the function performed by the computer hardware, including the CPU, input/output devices, secondary storage device, and communication and network equipment. Operating systems are the most important program that runs on a computer. Every general-purpose computer must have an operating system to run other programs. It perform basic task, such as recognizing input from keyboard, sending output to display units, keeping track of files and directories on the disks, and controlling peripheral devices such as disk drivers and printers.
Without an operating system, no computer can be operated. When an application program runs, the OS also works with hand. Examples: MS-DOS, Windows 3.1, Windows 95, Windows 98, Windows 2000, Windows ME, Windows XP, UNIX, LINUX, MINIX, etc.

Organization of an Operating System


 Fig: Position of OS in Computer system

Operating System has layer architecture i.e. each functionality creates one layer. The bottommost layer is the hardware. The heart of OS, which controls overall functionality of computer system, is called Kernel and remains always in the main-memory. Outside this layer is utility Software and applications. The uppermost layer consists of users.

Importance of Operating System
Operating System is important because it-
  Acts as an interface between user and computer hardware
  Runs all the application programs, system software, games, etc
  Controls overall operation of computer
  Manages Files and Documents
  Manages user requirements for programs, storage space and priority
  Organize and control hardware and software
  Initialize the hardware of the computer system
  Provides the management, scheduling and interaction of tasks
  Maintains the system and handle errors
  Protect hardware, software & data from improper use.
  Manages the use of main memory
  Checks equipment malfunctions & displays error messages.








OPERATING SYSTEM TYPES

In general, operating systems are organized by the size, type, and purpose of the computer on which they run. Below is a basic list of the different types of operating systems.

(1) Single-User/PC Operating System

Single user operating system provides an environment where single user can work. All the resources of the system are available to the single user. Example: MS-DOS.

(2) Multi-User/Server Operating System

This type of OS can fulfill the need of a number of users. This system divides the total time into a number of time slices and schedules the tasks one after another in a given priority. Example: UNIX, LINUX, Windows 2000 Server etc.

(3) Multiprocessing Operating System

Multiprocessing is the ability of the computer to simultaneously execute several programs in multiple CPU. If two or more processors are present in a computer system & are sharing the same memory, in such case, two programs may be processed at the same time. Thus in multiprocessing, more than one processor (i.e. CPU) are involved. 
Multiprocessing system is one in which more than one processor are linked together sharing main memory and other I/O devices. These processors can execute different independent program simultaneously. Example: MVS (Multiple Virtual Storage)

(4) Multitasking Operating System

Multitasking means being able to run more than one program simultaneously. For example, a user could be running a word processing package, printing a document, copying files to the floppy disk and backing up selected files to a tape unit. Each of these tasks the user is doing appears to be running at the same time. In multitasking, only single processor (i.e. CPU) is involved.

(5) Multiprogramming Operating System

While CPU is executing a program, another program has to wait until it finishes the job. If the first program requires certain I/O operation, the CPU waits for the I/O operation to get over and that wait time is called CPU’s idle time. In place of making CPU sit idle, another program takes over the use of CPU reducing its idle time. So operating system is responsible for increasing CPU utilization. This function is termed as Multiprogramming or CPU scheduling.
Multiprogramming improves the overall efficiency of the computer system by getting more work done in less time as the CPU may be shared among a number of active programs, which are present in the memory at same time. In multiprogramming, only single processor (i.e. CPU) is involved.

(6) Multithreading Operating System

A thread is a separate part of a process (program). A process can consist of several threads, each of which execute separately. Thus the operating system that supports multiple threads (subprograms) within a single application is called as multithreading operating system. For example, one thread could handle screen refresh and drawing, another thread printing, another thread the mouse and keyboard.


(7) Embedded Operating System

Embedded systems run as computer but not generally thought as computer, such as TV set, microwave ovens and mobile phones. These often have some characteristics of real-time systems but also have size, memory, and power restrictions that make them special.
Example: Palm OS and
Windows CE (Consumer Electronics).

(8) Real-time Operating System

A computer is sometimes expected to control the operation of a physical system without human intervention. Due to variation of the physical system, the computer has to act instantaneously to correct the variations. Any delay in response from the computer would be disastrous. System software can be installed inside the computer to work instantaneously for critical jobs. This software is called real-time operating system and the process is called real-time processing.
Real time operating systems are on-line systems that respond to input immediately. These operating systems are designed for the purpose of controlling and monitoring external activities with time constraint. These systems are characterized by having time as a key parameter. If the action absolutely must occur at a certain moment, we have a hard realtime system. Another kind of real-time system is a soft real-time system, in which missing an occasional deadline is acceptable.
Example: CCP (Communication Control Program) and BLMX (Broad Level Multitasking Executive)

(9) Smart Card Operating System

The smallest operating systems run on smart cards, which are credit card sized devices containing a CPU chip. They have very severe processing power and memory constraint. They can be general purpose or specific purpose.

(10) Network Operating System

The Network OS works under the client-server mechanism. Client-Server is a mechanism in which co-operation and intercommunication between various elements of network takes place and one machine (i.e. Server) “serves” others (i.e. Clients) for various functions. In a Network OS, the users are aware of the existence of multiple computers and can use the functionality of remote machines.
Example: Novell Netware.

(11) Distributed Operating System

A distributed OS is one that appears to its user as a traditionally uni-processor system, even though it is actually composed of multiple processors or computers. It aim user feels like he is working in a terminal in front of him, but actually the work may take place in any machine in network.

(12) Online Processing Operating System

To get immediate respond from the computer for any request of the user, it is possible to share large volume of data in disk storage so that data can be retrieved fast. To retrieve data available in the disk immediately, system software has been designed & this software is called on-line operating system and the process is called online processing.
Example: In computerized banks, the accounts of all the customers are stored in disk using the online O.S. the account of any customer can be retrieved immediately from the disk.


FUNCTIONS OF OPERATING SYSTEM


(1) Process Management

A process (or job) is a program in execution. The main objective of the process management module of an operating system is to manage the processes submitted to the system in such a manner to minimize the idle time of the various processors (CPU, I/O processors, etc.) of the computer system.
In early system, the method of job execution was known as the manual loading mechanism; jobs are manually loaded one after another by the operator. Problem was that a lot of computer time was wasted since the computer remained idle while operator loaded and unloaded jobs and prepared the system for a new job.

(2) Memory Management

A memory management is a procedure for managing the various programs residing in memory. In order to execute a program, it must be loaded into memory. As the program executes, the CPU reads program instructions and data from memory by generating addresses of the allocated memory. When the program terminates, its memory space is declared free and the next program may be given the same memory area.
Memory management technique is used by the multiprogramming operating system. There can be many programs loaded in the memory along with operating system. If there were programs larger than main memory of the computer, operating system uses free space of secondary memory (i.e. hard disk) which is termed as virtual memory. So a part of the program will reside in main memory and the other part will reside in secondary memory.

(3) File Management

The operating system manages the different files in the computer system. It provides following facilities.
Ø Maintain a mechanism of files and directories.
Ø Creation and deletion of files.
Ø Maintain authority over files by allowing different types of access permission and priority.
Ø Access to files for reading and writing
Ø Protect files against system failure
Ø Implements different types of efficient searching mechanism of files.
Ø Sharing of files between various users



(4) I/O Management

Computer systems include a wide variety of Input / Output devices. Such as printers, mouse, keyboard, hard disk etc. whose speed differs from each other. OS handles such different speed I/O devices. Operating system also manages the input to a computer system and output from a computer system. This applies to the flow of data among computers terminals and other devices such as printers. Application programs use the operating system to handle input and output devices as needed.

(5) Resource Allocation

There are various other resources in computer. They must be distributed efficiently between the programs without conflicts. For example program ‘A’ capture the tape drive and ask for CD-RW and program ‘B’ capture CD-RW drive and ask for tape drive. Then such situation creates “Deadlock”. OS avoids such condition and resources are efficiently distributed.

(6) Security

Another important function of OS is to provide security from unwanted intruders like human, viruses, etc. One of the major tasks of OS is to secure the data and program space of each job while loaded into the memory.

Other security includes
a.            User authentication: User identification must be checked by the system, before the user can actually use the facility.
b.            Access control: When a user passes the authentication phase and is allowed to use the computing facility, away is needed to prohibit the user from accessing those resource information that he/she is not authorized to access.
c.            Cryptography: Even if a user somehow manages to gain access to some information, which he/she is not authorized to access, away is needed to ensure that the user cannot make use of that information. This requirement is taken care by the cryptography mechanism.

(7) Interrupt handling

An interrupt is a signal generated or request raised by a source such as I/O devices. Interrupts are always given priority in computer system & occurs as soon as the device requires service. OS have one special program to serve the interrupts, Interrupt Service Routine, in which each hardware component is identified by its own Interrupt Request (IRQ) number like IRQ 1, IRQ 2 etc. When an interrupt is raised Interrupt Service Routine checks that interrupt request from where it occurred with the help of IRQ number and transfer to the processor.

(8) User Interface

With an operating system, we see and interact with a set of items on the screen what we called is user interface. There are mainly of two types of user interface:
Graphical User Interface (GUI):
Most current operating systems, including all versions of windows, Macintosh operating system, OS/2, LINUX, provides graphical user interface. Graphical user interface are so called because they use a mouse to point at graphical object on the screen. Some components of graphical user interface are: Desktop, Icons, task bar, start button, Menus, Dialog Box, etc. Command Line User Interface (CUI):
It is also called as Character User Interface. Command-line user interface does not use the pointing devices rather it has an environment that use typewritten commands. Each and every command should be remembered to execute certain operations. For examples DOS use prompt to receive certain command that are composed of strings like ‘dir’, ‘copy’ etc.


PROGRAMMING LANGUAGE

Programming language is a computer language, human-created language used to write instructions for a computer. It is the language used for communicating with the computer. It is the set of rules that provides the computer to perform certain operations. A language that is acceptable to a computer system is called a computer language or programming language.

PROGRAMMING

The process of writing instructions in such a language for an already planned program is called coding or programming.

COMPUTER LANGUAGE CLASSIFICATIONS

All computer languages can be broadly classified into the following categories:
  Low-Level Language o Machine Language (1st Generation Language) o Assembly Language (2nd Generation Language)
  High-Level Language o Procedural-oriented Language (3rd Generation Language) o Problem-oriented Language (4th Generation Language) o Natural Language (5th Generation Language)

LOW - LEVEL LANGUAGE

  Oldest programming language
  Use of binary numbers (1s and 0s)
  Directly controls CPU, Memory, and registers
  Two types – Machine language and Assembly language

(1) MACHINE LANGUAGE

It is the first generation language (1GL). It is a language computer can understand. It is composed of 0’s and 1’s. The machine language of a computer is normally written as strings of binary 1s and 0s. This type of program or source code written in binary form is called “Machine Code”.
Example: To write an instruction ADD 2 and 3 then we may have to write 01100001(i.e. ADD) 00000010(i.e. 2) and 00000011(i.e. 3)


Advantages of Machine Language

Program written in machine language can be executed very fast by the computer because no translation is required. It is the language of the computer It operates directly on hardware levels

Limitations of Machine Language

  Difficult to write, even if one bit change whole meaning may change.
  Lots of inputs required even for doing very small program.
  Because the internal design of every type of computer is different from every other type of computer, the machine language also differs from computer to computer. (i.e. machine dependent language)
  Writing a program in machine language is so difficult and time consuming that it is rarely used today.
  Programmer need to know the track of memory locations

(2) ASSEMBLY LANGUAGE

Use alphanumeric mnemonic codes, instead of numeric codes for the instruction while writing source code. These symbolic languages must be translated to machine language using assembler.
They are called as second generation language (2GL).
Example: MOV AX, 08
MOV BH, 30
MOV CX, 05 ADD AX, BH, CX

Advantages of Assembly Language

  Assembly languages are easier to understand and use.
  Less effort needed to write a program
  Easier to understand the mnemonics
  Programmers need not keep the track of the memory locations
  Programs can be revised quite easily

Limitations of Assembly Language

  Due to their close correspondence with machine language, different assembly languages had to be developed for each type of CPU (i.e. they are processor dependent)
  Programs written in one system could not be run on other systems without introducing significant changes.
  It is not a user-friendly language
  Programmers have to write a long sequence of instructions even for a small program
  An ‘assembler’ is needed to convert the assembly language to machine language
  Slow execution speed than machine language.



ASSEMBLER

The assembler is program that translates an assembly language program into an equivalent machine language. The assembly language program is referred to as “Source Program” whereas; the machine language program is referred as “Object Program”. Assembler also assembles the machine language programs into main memory of the computer and makes it ready for execution.


Fig: Assembler

HIGH-LEVEL LANGUAGE

High-level languages were designed to overcome their limitation such as machine dependent and machine level coding. They are similar to written English. Their syntax is more like a human language.

Advantages of High-level language


1.            Machine independence: A program written in a high-level language can be executed on many different types of the computers.

2.            Easier to learn and use: High-level languages are easier to learn, because they are similar to the natural language used by us in our day-to-day life.

3.            Fewer errors: While programming in a high-level language, a programmer need not worry about how and where to store the instructions and data of the program, and need not write machine-level instructions for the steps carried out by the computer.

4.            Lower program preparation cost: Writing programs in high-level languages require less time and effort, which ultimately lads to lower program preparation cost.

5.            Better documentation: The statements of program written in a high-level language are very similar to the natural language statement used by us in our day-to-day life. Hence a programmer familiar with the problem domain can easily understand them. As a result, very few, or practically no separate comment is required in program written in high-level language.

6.            Easier to maintain: Programs written in high-level language are easier to maintain, they are easier to understand, and hence, it is easier to locate, correct and modify instructions as and when desired.


Disadvantages of High-level language

  More time to execute
  No direct mechanism to control computer hardware.
  Programs execute more slowly.
  The languages use computer resource less efficiently.
  A compiler is needed to translate high-level language into machine language
  A set of rules must be followed when writing the codes



High level languages are of three types:
  Procedural-Oriented Languages
  Problem-Oriented Languages
  Natural Languages

(3) PROCEDURAL- ORIENTED LANGUAGE

General-purpose programming languages are called procedural languages or third generation language (3GL). They are languages such as Pascal, BASIC, COBOL and FORTAN, which are designed to express the logic, the procedure, of a problem. Because of their flexibility, procedural languages are able to solve a variety of problems.

Advantages of Procedural - Oriented language

  Easier to work as program statement resembles English-like phrases
  Machine-independent codes
  Once coded, it is easy to modify the program

Disadvantages of Procedural - Oriented language

  Programs execute more slowly
  These type of languages use computer resources less efficiently
  They use a text environment for programming


(4) PROBLEM- ORIENTED LANGUAGE

This is also known as 4GL. This is one step ahead from 3GL. These are result oriented and included database query language. There are fewer options for programmers, but the programs are much easier to write than in lower level languages. 4GL programs are also needed to be translated either by compiler or interpreter. In fact, 4GL cannot be used for allpurpose. They are dedicated for some particular application developments. Example of 4GL is C, C++, SQL (structured Query language), Delphi, ASP, PHP, VB.NET, Visual-Age, etc.






COMPILER

Since computer can directly execute only machine language programs, a high-level language program must be converted into its equivalent machine language program before it can be executed on the computer. This is done with the help of translator program, which is known as a compiler. A compiler is a translator program, which translates a high-level languages program into its equivalent machine language program. Compiler is language dependent. FORTAN compiler can’t compile COBOL program. In additional to translating, compiler also automatically detects and indicates certain type of errors in source programs.

INTERPRETER

An interpreter is another type of translator, which is used for translating programs written in high level languages. The working principle is different from that of compiler in the sense that interpreter reads each line at a time and execute. So result is program execution not an object program. As compared to compiler, error is detected and brought to the attention as soon as the program is interpreted. The main disadvantage of the interpreter is that they are slower than compiler. Both interpreter and compiler can be combined. Interpreter debug program and then after a bug-free state is reached, the program are compiled.

 
  

 (5) NATURAL LANGUAGE

It is also known as 5th generation language. It is still in development and most probably is the language of 5th generation computer. In such a language we would write statements that look like normal sentence. Natural languages have two characteristics:
              They are designed to make the connections that humans have with computer more natural –more humanlike.
              They are designed to allow the computer to become “smarter” – to actually simulate the learning process by remembering and improving upon earlier information.

SOFTWARE LIFE CYCLE

It is a standard process followed in order to conduct all the steps necessary to analyse, design, implement, and maintain software. It is a systematic process of building a software system. It is often known as system development life cycle (SDLC). SDLC is composed of series of phase like - Problem Definition, System Analysis, System Design, System Implementation, System Testing & Verification, and System Maintenance. Together these phases are called “life cycle” because they cover the entire “life” of software system.

PROBLEM DEFINITION

At this stage, the problem to be solved or the task to be performed is defined. I/O and processing requirements are also specified. The programmer needs to know exactly what the program is required to do.

SYSTEM ANALYSIS

This phase is concerned with what the system will do? It is not is concerned with “how”. In this phase, developers use various tools like Data Flow Diagram (DFD) and EntityRelationship Diagram (E-R Diagram) to show the internals of the proposed system. The entire system is divided into small parts and the data used by systems are analyzed.

SYSTEM DESIGN

This phase is concerned with how the system works? Each nodules are further broken down into smaller pieces and elaborates minutely with the help of Flow-Chart or Pseudocode. The design process may follow Top-down approach or Bottom-up approach.

SYSTEM IMPLEMENTATION

In this stage, the instructions written in Pseudocode are written in a programming language. The programming language may be C, C++, BASIC, and Pascal etc. If programs have to be written in a very strict format, and are to be typed by someone other than the programmer, then they are first written on special forms called “Coding Sheet”.

SYSTEM TESTING/VERIFICATION

At this stage, the program is tested to check whether it performs the required task or solves the given problem. Here, errors in the program are also detected and corrected. The testing can be broadly categorized into two types:

Black Box Testing: Known input is provided and checked whether system generates expected output or not.

White Box Testing: Every possible course of action inside the code is checked thoroughly.

SYSTEM MAINTENANCE

This is a continuous process and is done until the lifetime of software. A software system never becomes 100% corrects and it needs continuous maintenance. No matter how good the new system is, how well it was installed, and how well it may be currently operating, sooner or later it will need to be modified due to one or more of the following reasons:

Changes in business condition or operations of the organization using the system
Changes in organizational policies or enforcements of new laws
Changes in user need, such as demand for additional features or output reports
Changes in technology, such as availability of new and more powerful processors, more efficient storage, more convenient I/O device, new system software etc.

System maintenance is an important phase of the overall life cycle of a computerized system, and its importance should not be under estimated. In fact, several studies have show that, on an average, the maintenance cost of a computerized system is two to four times more than the initial development cost. This means that more than half of the programming tasks in this world involve program maintenance.


TYPES OF PROGRAMMING ERRORS

1.            Syntax Error: Syntax error result when the rules or syntax of the programming language are not followed. Such program errors typically involve incorrect punctuation, incorrect word sequence, undefined terms, or misuse of terms. For example, the statement C–(A+B/2 has a syntax error, because of the missing closing parenthesis, which should be place in the appropriate place, depending on the logic of the program. A program cannot be successfully compiled and executed until all its syntax error has been corrected.

2.            Logical Error: A logic error is an error in planning the program’s logic. Such errors cause the program to produce incorrect output. That is, a program, which is free of syntax errors, but has one or more logic errors, will be successfully compiled and executed, but will not produce correct result. The problem is that, since the program contain logic error, the logic being followed during its execution will not be correct. Hence, the program will not produce the desired results.
For example if instruction should be “A=B+C”, but has been coded as “A=B–C”, it is an example of logic error, because the result produced by the program will not be correct.

 

PROGRAMMING TOOLS

Some of the programming tools are as follows:
1.  Algorithms
2.  Flowcharts
3.  Pseudocodes
4.  Decision table
5.  Decision tree

ALGORITHMS

Algorithm is a step-by-step description of how to solve a particular problem. Algorithms are converted into codes or programs by the programmers. Algorithms make the program development easier for the programmers.
The desirable features of an algorithm are:
  Each step of the algorithm should be simple.
  It should be unambiguous in the sense that the logic should be clear.
  It should be effective.
  It must end in finite number of steps.
  It should be an efficient as possible.
  One or more instructions should not be repeated infinitely.
  Desirable result must be obtained on the algorithm termination

Example: Algorithm to multiply two numbers a, b.
Step 1: Start
Step 2: Input numbers a and b
Step 3: Multiply a and b & store on c, i.e. c = a*b
Step 4: Display the value of c
Step 5: Stop

FLOWCHARTS

The pictorial representation of the programs or the algorithm is known as flowcharts. It is nothing but a diagrammatic representation of the various steps involved in designing a system. A flowchart consists of a set of ‘flowchart symbols’ connected by arrows. Each symbol contains information about what must be done at that point & the arrow shows the ‘flow of execution’ of the algorithm, i.e., they show the order in which the instructions must be executed. The purpose of using flowcharts is to graphically present the logical flow of data in the system and defining major phases of processing along with the various media to be used.


Some Symbols used in designing flowchart



  Terminal Symbol: It is used to indicate a point at which the flowchart begins or ends.
    The words START & END are written within the terminal symbol.
  Process Symbol: This symbol represents some operations on data.
  I/O symbol: It is used to represent the logical positioning of input/output operation. Decision symbol: This symbol represents a logical operation showing a decision point in a program.
  Connector symbol: It is used to indicate a junction at whom the flowchart comes from a part of the flowchart on another page.
  Flow symbol: A flow symbol is an arrow that shows the flow of program logic in a flowchart.
Example: A Flowchart to calculate the product of two numbers


Advantages of Flow Chart

  A flowchart is a pictorial representation of a program. Hence it is easier for a programmer to explain the logic of a program through flowchart. Easy to convert flowchart to programming language
  Easy to detect, locate and remove bugs in a program
  Efficient means of communication

Limitations of Flow Chart

  Very time consuming and laborious job Redrawing a flowchart is a tedious task How much to include in flowchart is unclear.
  Occupies space while documentation
  Translation of flowchart to computer program is difficult

PSEUDOCODES

Pseudocodes are phrases written in ordinary natural language, which cannot be understood by the computer. It is a structure way of writing program and resembles to computer instruction.

Example: Suppose that National Book Center decides to prepare a Book club. Members of the club are entitled to special discounts on the purchase of books; the discount of 15% if their purchase exceeds Rs. 5000 otherwise 10%. Non-members aren’t normally given any discount. However if their purchase exceeds Rs.5000 a discount of 7% is given.
The following is the Pseudocode version of the above discount policy
IF Member THEN
IF Purchase > Rs 5000 THEN
Discount is 15%
ELSE
Discount is 10%

ENDIF


ELSE [purchaser is not a member] IF Purchase > Rs.5000 THEN
Discount is 7%
ELSE
No discount
             ENDIF ENDIF

Advantages of Pseudocode

1.  Converting a Pseudocode to a programming language is much easier.
2.  Easier to modify.
3.  Involves much less time and effort

Disadvantages of Pseudocode

1.  Complex to understand for beginners
2.  No common standard

DECISION TABLE

A decision table allows an analyst to set out in a clear way what could be a confusing situation. It consists of two parts: Conditions & Actions

Example: Suppose that National Book Center decides to prepare a Book club. Members of the club are entitled to special discounts on the purchase of books; the discount of 15% if their purchase exceeds Rs.5000 otherwise 10%. Non-members aren’t normally given any discount. However if their purchase exceeds Rs.5000 a discount of 7% is given.
  

DECISION TREE

A decision tree is another way of presenting a potentially confusing situation in a clear, concise & unambiguous manner.

Following figure illustrates the decision tree for the discount policy.



Thank you!!

2 comments:

Powered by Blogger.