computer programming by prof.(dr.) anand k. tripathi ,mrs monika tripathi

83

Upload: prof-dr-anand-k-tripathi

Post on 03-Jul-2015

215 views

Category:

Education


1 download

DESCRIPTION

Computer Science & Engg.

TRANSCRIPT

Page 1: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi
Page 2: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Programming Language

Page 3: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What do you understand by programming language?

Ans. Programming Language:

To write a computer program, a standard programming language is used: programming language is composed of set of instructions in a language understood by the programmer. Programming languages may be divided into three broad categories:

1.Machine Language

2.Assembly Language

3.High level Language

Page 4: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(1) Machine language: The language

understood by machine is known

as machine language.

Programming is done at machine

level. The vocabulary of computer

consists of only 2 words 0 and 1,

i.e. digits of binary number system

where 0 indicates low voltage level

and 1 indicates high voltage level.

It is considered as 1st generation

language.

Page 5: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Advantages:

It can be directly typed and executed.

No translator program is required.

• Disadvantages:

Difficult to remember machine instructions.

Difficult to understand modify and debug error.

Difficult to remember addresses of data and instrument.

Each and every information is numerical.

Lack of portability program that runs on one machine doesn't run on the other.

Page 6: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(2) Assembly language: To overcome

the drawbacks of machine level

language. Scientists developed a new

programming language which uses

symbolic instructions. This symbolic

instructions oriented programming

language is known as assembly level

language. This is Called second

generation language.

Page 7: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Advantages:

1. Easy to remember operator codes.

Easy to understand the program.

Easy to write, modify and debug the program as compared to machine language.

Need not remember addresses of operant (+,-,*) and instruction.

• Disadvantages:

Not standardized.

Less efficient than machine language.

Memories are machine dependent. They differ from computer to another.

Page 8: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(3) High level language: It is totally

machine dependent language.

COBOL, BASIC PASCAL, ADA, C is

all high level languages. The

programs written in any of these

languages can be executed on any

machine.

Page 9: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Advantages:

1. Programs are portable.

2. Debugging is easier.

3. Most suited for software

Development.

4. Programs are not machine

dependent.

Page 10: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. Which was the first Electronic

Computer?

Ans. The first electronic computer was

the ENIAC (Electronic Numerical

Integrator and Calculator).

Page 11: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. Write the name of few different kinds of chips as used in computers?

Ans. The following types of chips are used in computers.

MEMORY CHIP

C.P.U. CHIP

MIRCOPROCESSOR CHIP

• Each of the above mentioned chips has special circuits designed to do the particular job. Memory Chips store the information others may work in the arithmetic unit. Some chips can do all the work which a computer is supposed to do and these are called as microprocessors. Such chips are known as Computer on a CHIP

Page 12: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What do you understand by programming? How high level programming language is used for systematic development of programs?

Ans. We know that that computer is only a machine which requires a series of instructions telling it what to do. The set of sequenced instructions which tell the computer to perform certain particular task is called a program.

• There are two types of program:

Page 13: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

1. System Programs: Programs that

control and direct the operations of

computer hardware are system

programs

2. Application Programs: Programs

that help the user and the system

programs to work together are

called application programs.

Page 14: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Definition of Programming:

• Programming is a technique of

developing programs in order to

achieve the desired goals using

computers.

Page 15: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Methodology for Systematic Development of Programs for High level Language: A high level programming language must contain the following qualities for Systematic development of programs

1. A program should be correct and designed in accordance with the requirement laid out during the analysis of the program.

2. Program should be easy to understand .It should be designed in such a way that anyone can understand its logic.

Page 16: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

3. A program should be easy to

maintain and update.

4. It should be efficient in terms of

the speed and use of computer

resources such as primary storage

memory etc.

5. It should be reliable.

6. It should be flexible.

Page 17: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. Write the steps for designing and implementation of correct, efficient and maintainable programs?

Ans. Designing and implementation of correct, efficient and maintainable programs is done by a systematic way of doing things. This consists of a set of guidelines, rules, concepts and practices which taken together are given the name structured programming.

A good program can be developed by following recommended series of steps

Page 18: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

1. Defining the problem

2. Designing the algorithm

3. Coding the Program

4. Testing and debugging the

program.

5. Implementing the program

6. Maintainable and upgrading the

program.

Page 19: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Defining the Problem:

It involves

(i) Recognizing the problem.

(ii) Identifying exactly what the problem is.

(iii) Determining the available inputs and desired output.

(iv) Deciding which configuration of computer is required to problem . computer.

Page 20: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Designing the Algorithm

An algorithm is the finite set of step-by-step instructions that solve a program.

After defining the problem,, algorithm can be designed by using design aids which

are:

• Structure charts

• HIPO charts

• Pseudo code

• Flow charts

Page 21: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Structure Charts

It is design aid in which the purpose of a

module, the relationship to other modules

and the overall program logic flow are

shown. Each module (a small segment of

a program) is represented by a box;

Page 22: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• HIPO (Hierarchy plus Input

Process Output) Chart:

HIPO chart can enhance a

structure chart by outline the

input, processing and output

needed by each module. With

respect to above structure chart

, HIPO cart is drawn:

Page 23: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

It is a tool used to formulate the processing steps of a program. Pseudo code uses

English phrases to describe the processing steps of a program or module.

The logical control instructions within a structured design are emphasized in a pseudo

code. Thus, the following logical control instructions arc always capitalized.

Page 24: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(I) PERFORM UNTI.. … END PERFORM or DO WHILE………ENDDO

These are used to indicate a sequence that will be executed until a specific condition is met.

PERFORM UNTIL END PERFORM is a COBOL expression; DO WHILE…ENDDO is a FoxPro expression.

Page 25: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(ii) IF - - - THEN - - - ELSe…….ENDIF

This is used to test a specific condition. IF a condition exists THEN perform some operation;

ELSE perform some other operation.

Illustrations of the pseudo code has been discussed in detail in previous chapters.

Page 26: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Flow Chart:

It is a design tool comprising of standardized symbols to show the components of a system

or the steps in solving a problem. It is the most popular and commonly used design aid

A detail of the flowchart has been taken in previous chapter.

Page 27: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• 4. Testing and Debugging the Program:

After coding, the program must be tested to ensure that it is correct and contains no errors. Three types of errors or bugs can be found which are;

• Syntax error

• Logic error

• Run-Time error

Page 28: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Syntax error: Syntax is a set of rules by which a programming language is governed.

Syntax error occurs when these rules are violated while coding of the program.

Logic error: This type of computer program error is caused by improper coding of either

In­dividual statements or sequences of statements, It docs not stop program execution but

gives wrong results,

Run-Time error: This error in a computer program stops its execution. It may be caused by entry of Invalid data.

The process of finding any type of errors mentioned above and correcting them is known as debugging

Page 29: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• 5. Implementing the Program:

After a program has been listed and debugged, it can be installed and implemented.

Maintaining and Upgrading the Program:

After installation of a program, it needs to be maintained for future use. A program once developed and implemented can be upgraded as per the requirements of the user. Maintaining and upgrading the program is an ongoing process.

Page 30: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Q. What do you mean by dumb terminal and smart terminal?

Ans. A dumb terminal consists of VDU and a keyboard. It has no CPU of its own, and the processing is done only by the central unit.

A smart terminal has its own CPU and peripherals also and therefore it is capable of doing its own processing at their end also. So smart terminal can also work independent of the central CPU too.

The advantage of this feature is that some other OS can be loaded to its own hard disk and connection to UNIX can be established when required.

Page 31: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

1. Weight of the brain is about 1.5 kg.

2.The various parts of the brain like

Cerebrum, Cerebellum, Medulla

Oblongata etc. must stay together for

its functioning.

3. Intelligence is rated as I.Q. — the

level of human intelligence various

from 0 to 100.

4. The energy source is blood

glucose.

5. It needs a steady temperature.

Page 32: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

6. It is assumed that computing

elements in the brain are about a

hundred thousand million.

7.The memory recall can be rapid or

slow.

Page 33: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

COMPUTER

(1)Weight of the computer varies from a few grams to a few tones.

(2)The various parts can be placed at different places. They can be linked by wires, satellites and laser beams etc.

(3) I.Q. (Intelligence Quotient) is zero. It cannot think and whatever intelligence we feel it has it is actually on account of the efforts of the scientists and technocrats.

(4) Electricity is the energy source.

(5) It is less sensitive to heat or cold.

(6) It has about thousand million basic computing elements and they are increasing day by day.

(7) The access speed to memory is limited.

Page 34: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What are the characteristics of high level languages?

Ans. The following four characteristics are associated with the high level languages.

(1)Machine independence. Machine independence means that a high level language could be used on any of the computer systems without making changes or at the most by making minor changes.

(2)Use of a compiler. A compiler is a program, similar to an assembler, which translates the high level languages programes to machine language. Thus the translation work is done by the computer itself and the programmers are not taxed with this translation work.

Page 35: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(3)Self documentation. On account of this feature the syntax errors, the errors caused on account of improper use of high level language, are automatically pointed out to the programmers. This is done via an operational software. Once these errors are known then programs can be debugged.

(4) Standard language format. The standardized language format provides level of uniformity to the language. Manufacturers do add special touches to standard versions to make them look attractive to the buyers.

Page 36: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What is bugs and debugging?

Ans. Mistakes in a program is called

"bugs" and correcting those

mistakes is known as "debugging".

Page 37: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. WHAT IS MACHINE LANGUAGE?

Ans. The Machine Language is the language directly understood by a computer. In other words the binary language (the language of O's and l's) is the machine language. Any information or instruction in this language is to be represented in terms of O's and 1's. The symbol 0 standing for the absence of an electric pulse and I for the presence of an electric pulse. As a computer is able to recognize the presence or absence of an electric pulse, so it enable to understand the machine language. For example a sequence of O's and 1's such as 01110001 has a specific meaning for a computer, although it may appear as an ordinary binary number to us. This sequence may be fed to the computer by electric pulses in different time cycles

Page 38: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What is word processor?

Ans. Word processor is a microcomputer operating with special purpose software (e.g. WORD) which processes character strings. It is commonly used for office automation purpose for production of documents such as reports, letters, tenders, etc. Word processor accepts text as input which can be edited and laid out as desired. Word processors are usually equipped with a floppy disk drive and good quality printer.

Page 39: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What do you mean by computer simulation and what is its purpose?

Ans. In computer simulation mathematical model of the process/equipment under study is fed into the computer and the computer output represents behavior of the process under various operating conditions.

Simulation is used to study the performance of system using a model and also for training purpose. Such models can be physical (as air plane placed in a wind tunnel) or mathematical (series of equations describing a system as a model of thermal power plant).

Page 40: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. Why was machine language discarded ?

Ans. The writing of programs in machine language is very cumbersome and complicated task and it can be accomplished only by the experts. Machine language programming requires that all the information to be fed to a computer must be in numeric form and that too in binary language. Moreover, addresses of all the locations storing instructions and data must be known to the programmer and he should be able to address these locations correctly. Thus instructions stored in the computer in this manner are interpreted and obeyed by the computer. In other words, writing of a program in a machine language was a specialist's job and common man could not do it. This language was discarded due to these difficulties.

Page 41: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What do you understand by bit, byte and word?

Ans. A Binary Digit (BIT) (0 or 1) is called bit. One bit occupies one store location. A group or combination of 8 bits is called a byte. A computer word is a combination of one or more bytes handled together as one unit for processing and may thus be of 8, 16, 32 or 64 bite. The length of word varies from machine to machine but it predetermined for each machine.

In some computers, the grouping of bite, bytes or words is flexible in design to meet the differing storage requirements of numbers, alphanumeric characters and instructions.

A computer reads and processes all the bits of the word at a time.

Page 42: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What do you understand by Programming Environment?

Ans. Every one, who is ready to make a program, has to choose a programming environment that make to possible to create and run the program. Different types of programming environment is as follows:

1.Batch processing environment:

2.Time sharing Environment

3.Client Server Environment

4.Distributed Computing Environment

Page 43: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

1.Batch processing environment: In this programming environment data is collected over a period of time and then processed periodically. It is used for office work like accounts, salary etc.

This type of environment is normally used with general purpose computers for applications, like preparation of bills, accounting jobs etc. However this environment is not useful with process control

Page 44: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

2. Time sharing Environment: This

Environment provides the concurrent

use of a single computer by many

users. Each having his own

input/output device and accessibility

to computer at the same time.). The

computer in such cases gives each

user a small, but frequently repeated,

slice of the time, so that each user

gets almost immediate response.

Page 45: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

3. Client Server Environment: A client/server programming environment splits the computing functions between a central computer and users’ computers. The users are given personnel computer at their own sitting place or workstation so that some of the computation responsibilities can be moved or shared from the central computer and assigned to the workstations. In client/server environment, the users’ micro computers are called the client. The central computer, which may be a powerful micro computer known as server.

• Since the work is now shared between the users’ computers and the central computer, response time and monitor display are faster and the users are more productive.

Page 46: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

4. Distributed Programming Environment: In a distributed programming environment different departments in an organization acquires a computer of their own for their applications but all these computers are connected through a central computer which can control other computers.

• -With this regard data is physically located at different sites but logically interconnected.

Page 47: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• It offers many advantages –

1.Better user acceptability

2.Better information processing as data is captured by the computers at the respective work sites within the user departments.

3.Fixing up of the responsibility by the users

4.Better computer availability.

5.Minimum communication cost as the data is proceed locally.

6.More applications are put on the computers due to better user experience, knowledge.

Page 48: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. Who, when and where this first electronic computer was produced?

Write its characteristics also?

Ans. First Electronic Computer was produced in 1946 in the Moore School of Electrical Engineering at the University of Pennsylvania. . It was extremely fast by the standards of the day. It could multiply two 10 digit decimal numbers in 3 milliseconds. A large team was responsible for the design and construction of ENIAC.

• This computer did not have memory unit and did not use stored program concept. The programming had to the done manually by plugging and unplugging sets of connecting wires. Data could be entered using a punched card reader, and results output on punched cards or on an electric type writer.

Page 49: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What are touch sensitive screens?

Ans. There are some VDUs equipped with touch sensitive screens. They allow data to be input by touching the screen by means of a LIGHT PEN, a GRAPHIC PLOTTER and a GRAPHIC TABLET. The screen surface consists of a number of 'touch points' as defined by the program in use. When touched, the terminal sends the co-ordinates of these points to the 'memory of the computer.

Page 50: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q Explain Visual display unit (VDU)

Keyboard

Ans.Fig-5 This is another popular input/output device for low volume input and output. It consists of a key board identical to a type writer key board with some special keys and a CRT (Cathode Ray Tube) screen which displays the input and the output.

Page 51: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• This device is very popular as it is not very expensive and quite simple to operate. Micro-computers use this device for input and output operations. One disadvantage is that this device provides no hard copy (a printed copy) of the output but it is possible to add a printer to this device which can be attached to it for getting a hard copy. However it is usually suited more to those applications where hard copy is not needed. It is more suited for on line activities like airline seat reservations where speed is needed to handle passengers' enquires. It is for this reason that VDUs are fast becoming a part of office equipment.

Page 52: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. Write first four generations of computers and in what way each generation was better than earlier.

Ans. First generation computers developed during the year 1951 to 1959 were based on vacuum tubes. These computers were very slow in operation (approximately 1000 instructing/second), big in size and unreliable. Size of the memory was limited. These computers consumed huge electric power, generated lot of heat and needed much air conditioning. UNIVAC 1 and IBM are examples of first generations computers.

Page 53: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Second generation computers developed during the years 1960-1965 were based on transistors. Transistors perform the same function as vacuum tubes but are smaller, more reliable, faster, consume less power and generate less heat than vacuum tubes. As a result second generation computers based on transistors were faster in operation (approximately 106 operations/second), smaller is size and much more reliable than the first generation computers. New techniques such as operating system, time sharing etc. also came to be used in second generation computers. Auxiliary memory in the form of magnetic tape was also introduced. With the ability to store large volume of data, the data processing fraternity bagan to look with interest at the possibility of using computers for commercial applications and this resulted in phenomenal growth of computers. UNIVAC 1107, IBM 7090, CDC 1604, Honeywell 800 are few example of second generation computers.

Page 54: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Third generation computers employing integrated circuits (ICs) were introduced between 1965 and 1970 and are also being used presently. Integrated circuits based on silicon technology are much smaller in size, more reliable, faster and less expensive. Third generation computers built around integrated circuits are therefore, faster in operations (approximately 109

operations/second), smaller in size and more reliable than second generation computers. These computers employed higher capacity internal storage, and wide range of peripherals came to be used. New concepts e.g. multi higher capacity multi-processing use of high level languages were used in these computers. Some of the third generation computers are IBM-360/370, Honeywell 6000.

Page 55: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Fourth generation computers based

or VLSI (very large scale integration)

chips and microprocessors chips

were introduced in 70s. this

generations also includes

microcomputers, office automation

systems, distributed processing

systems. Computers in these

generations have become less

expensive, faster in operation and

more reliable.

Page 56: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What do you understand by knowledge information processing systems (KIPS) or fifth generation of computers?

Ans. Computers based on Artificial intelligence are termed as fifth generation computers. These computers mark major shift from the previous four generations of computers as these are equipped with reasoning and decision making capability close to that of human being. These computers are also called knowledge information processing systems (KIPS).

Page 57: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What are super computers and for what purpose these are used?

Ans. Super computers are large general purpose computers capable of executing more than 100 millions instruction per second and have a storage capacity of millions of bits. The high speed in these computers is due to use of a number of processors working in parallel and high storage densities are obtained by using magnetic bubble memories and charge coupled divides, weather forecasting etc.

Page 58: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What is a microprocessor?

Ans. A microprocessor is a L.S.I (large

scale integration) chip which can

perform the function of central

processing unit (CPU) of digital

computer. Apart from computer

microprocessor are also used in

electronic calculators and many

house hold appliances viz. TVs.

VCRs, washing machines etc.

Page 59: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What is the difference between a microprocessor and a microcomputer?

Ans. Microprocessor is a L.S.I chip which performs the functions of central processing unit (CPU) of a digital computer. In order that a microprocessor become full fledge microcomputer , main memory unit, input and output devices, auxiliary storage devices and a set of operating system programs have to be added to it.

Page 60: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What do you understand by single-chip microcomputer? For what applications it is used?

Ans. A single chip microcomputer consists of a single chip on which the central processing unit input/output and memory units are integrated. This is used for industrial applications and also in pocket calculators.

Its advantage is the reduction in cost and size, increase in performance and reliability.

Page 61: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What do you understand by “Computer Graphics”?

Ans. The term Computer Graphics refers to the concept of man communicating with a computer by means of graphical symbols such as dots, lines corves, alphabetical or numerical symbols, etc. This mode of man machine communication provides for a high rate of information transfer. Examples of computer graphics are bar charts, graphs, curves, engineering drawings, fashion patterns, etc.

Page 62: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What led to the development of high level languages?

Ans -Practically speaking the drawbacks associated with machine and assembly languages led to the development of high level languages. Both these languages consumed to much of time in writing a program. Correcting errors took even more time. The writing of programs in low/machine level languages is a highly specialized job beyond the comprehension of a layman. So the move towards development of an easier computer language led to the development of High Level Languages.

Page 63: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q.What do you mean by micro

computer and micro processor?

Ans. A micro­processor is a C.P.U. on

a single chip, where as the machine

which uses this chip is a micro

computer.

Page 64: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. WHAT ARE OPTICAL CHARACTER READER (O.C.R) ?

Ans. Optical Character Reader (O.C.R.) is an input device. It is so designed as to read, numeric and alphabetic characters from printed documents. However the recent OCRs can read hand written characters with a rare rejection rate. This is a photo­electric device as the shape of the characters is recognized with the help of light source which converts characters into electrical signals and then these are analyzed and identified. The speed of these readers can be up to 6000 documents (of an average size) per minute.

Page 65: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Optical readers read the source documents directly so it saves the time and money in transferring the data from the source document to the other input media. If the system is developed further so as to recognize the imperfectly written characters then these OCRs will supercede all the existing" input methods of key punch and key board. The optical character reader is used in turn-around documentation, such as processing of gift coupons and puzzle solutions. Its use has reduced the manual key stroke operation required for preparing the source documents.

Page 66: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. In what way computers helps in engineering field?

Ans. Computers help engineers to solve complex problems that could not have been solved by other methods.

• These relieve engineers of many tiring and time consuming chores, thereby enabling them to spend more time on other important aspects.

• These enable them to achieve higher standards of product design and better meet tight development schedules.

• These enable to perform more rigorous analysis of design problems.

• The characteristic of computer to store vast quantities of information and retrieve the desired information instantaneously can be best exploited to improve designs and save time in searching for old piece of useful information.

• In brief, computers enable engineers to over me problems like short time schedules, growing complexity of products process and higher standards of product design.

Page 67: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. How optical mark readers (OMR) are used?

Ans. Optical Mark Reader (OMR) is an input device which interprets pencil marks on paper media which can be a 80 column card or a full page. -Its main application is in judging the I.Q. through multiple choice or objective type questions. Here the candidate is advised to put a dot with soft pencil in front of the correct answer at a specified spot. Then these papers are processed by an optical mark reader one by one. A thin beam of light is projected on the paper. The amount of light transmitted through the dot is less as compared to its surrounding area and this leads to the right answer being evaluated. About 10,000 documents can be processed just in one hour and this enables the preparation of examination results in a very short time.

Page 68: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What type of organizations use MICR? How data is processed? Why MICR was developed?

Ans.Magnetic Ink Character Readers (MICR) devices were developed in the late 1950 to assist the banking industry in automation of the processing of input cards and paper documents which are written with a magnetic ink which contains iron oxide particles in it. The characters have a standard configuration which makes them recognizable to humans and at the same time provide signals produced by the read head to electronic circuitry. These signals are analyzed to sense the characters used and then these are transmitted to the memory unit. MICR is an example of pattern recognition technique and has successfully replaced the time consuming and the expensive punched card processing.

Page 69: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

• Advantages: MICR has the following advantages.

1.Reading of characters is accurate by means of this input device.

2.The characters can easily be recognized by the human beings.

3.The device is quite reasonable in cost.

• Disadvantage The less number of the characters recognized by it makes its use limited to the cheques only and so it cannot be used for general purpose data processing.

Page 70: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. Distinguish between source program

and object program.

Ans. A program written in any language

except that of machine language is

called a SOURCE PROGRAM. The

program in machine language is

known as OBJECT PROGRAM. For

example' a program written in „C‟

language/editor is a source program

and the computer transforms it to the

object program.

Page 71: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. How you can classify the various types of computers?

Ans. There are several ways of classifying computers.

(1) Depending on Generation.

i) First generation, based on vacuum tubes.

ii) Second generation, based on transistors.

iii) Third generation, based on small scale integrated circuits.

iv) Fourth generation, based on large and very scale integrated circuits (microprocessor based)

v)Fifth generation, having artificial intelligence.

Page 72: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(2) Depending on the principle of working, these are classed as:

i)Digital Computers – In which mathematical expression are represented as binary digits and all operations are done using these digits at very rate. These produce very accurate and precise results.

ii)Analog Computers – These obtain continuously varying signals and thus depend to a great extent on accuracy of measurement of signal. These are fast and best suited for solving differential equations.

iii)Hybrid Computers – These use best qualities of both analog and digital computers.

Page 73: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(3)Depending on the size of the computer. These could be classified as:

i).Large Scale Computer – It may have one or more CPUs for computation. The main storage capacity may be several million characters and the secondary storage capacity ranges in billions of characters. The terminals are connected at several places for interaction with computer by several users. The system can typically work on a number of different programs.

Page 74: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

ii)Medium scale and small scale

computers – These have same

feature as large scale but the storage

capacity reduces. All these are

basically main frame computers, i.e.

whole of the CPU is concentrated at

one central place. In contrast to this.

Distributed arrangement is also

possible in which case CPU is

distributed physically and

computations are thus carried out

locally at several places.

Page 75: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

iii)Minicomputer system- It is small in

size that is can be mounted on a rack

or put on a table. It is fast in the basic

operations but has a limited set of

instructions. Main memory is of the

order of 8 K 32 bytes, and number of

input/out put devices is also limited. It

is frequently dedicated to a specific

function

Page 76: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

iv)Microcomputer or desk top

computer – With further reduction of

main memory and word length

smaller and smaller computer

systems have been produced. These

cost less and less.

Microcomputers are much more cost

effective than minicomputers.

Microcomputer CPU on a chip is

being used in a variety of

applications.

Page 77: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(4)Depending on the purpose for which they may be classified as

i)General purpose computers which perform almost unlimited variety of functions with the help of proper programming. General purpose computer us used mainly for processing complex numerical calculations and accounting work.

ii)Special purpose computers which are designed for some particular purpose. For instance, process control computer is employed for controlling and monitoring thermal power plants, steel plants, chemical plants, etc.

Page 78: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

iii)High intelligence machine com

machine computers (which are used

for remote and servo-controlled

applications, like robots, rocket

launching pads etc. )

iv)Knowledge information Processing

System (these have been developed

recently and these possess the ability

of reasoning, thinking and decision

making).

Page 79: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

(5)Depending on the processing modes, these can be categorized as :

i)Batch processing mode: (First data is collected over a period of time and then processed periodically). It is used for office work like accounts, salary etc.

ii)Real-time computers (each transaction is processed as soon as it is received, there being no waiting time for accumulation of a batch of transactions). It is used for on-line processes and where immediate response is required.

Page 80: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

iii)Dedicated to regularly scheduled jobs. (in This mode only one request is considered at a time)

iv)Time sharing mode (concurrent use of a single computer by many users. Each having his own input/output device and accessibility to computer at the same time.). The computer in such cases gives each user a small, but frequently repeated, slice of the time, so that each user gets almost immediate response

Page 81: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What does it mean that Computer

is automatic machine?

Ans. Computer is automatic means

that once the instructions are fed and

the process is begun, it would

continue without the need for human

intervention until completion.

Page 82: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

Q. What is the advantage of using high level language?

The high level language possesses many advantages over low level language. A few of these advantages are listed below:

1. The high level languages being similar to commonly used languages in our day to day work are quite easy to learn and use.

2. Since the syntax of these languages is similar to the commonly used languages due to which the writing of source programs becomes very easy.

3. The writing of source programs in these languages does not require the knowledge of the internal structure of the computer.

4. Allocation of memory locations for instructions and data is done by the machine itself and the user is not to bother about it.

Page 83: Computer Programming By Prof.(Dr.) Anand K. Tripathi ,Mrs Monika Tripathi

5. The number of instructions given to the machine are greatly reduced as compared to number of instructions required for an equivalent machine language or assembly language program. Actually an instruction in high level language may be broken down to a large number of machine language instructions and fortunately this job is performed by the computer and not by the programmer. For example a single instruction in a high level language may be split into 10 or more instructions in machine language.

6. These high level languages, unlike low level languages which are machine oriented languages, are problem oriental languages or procedure oriented languages.

7. Modifications, if required, in programs written in these languages are quite easy and straight forward.