Chapter 1
Chapter 1
COMPUTER STUDIES
CLASS 12TH NOTES
Chapter # 1
Concept of Computer Programming
Chapter # 1
Concept of Computer Programming
Programming :
Programming is a process of creating a set of instruction that tells the computer how to
perform a task. Programming is a combination of art and science. It is an art because it provides
different way of coding and instruction for different task. It is a science because there are several
rules and logics to follow. Programming can be done using a variety of computer programming
languages, such as JavaScript, Python, and C. programmer have to ensure that the program
should be economical efficient and effective. Software also called software engineering.
Reason for learning programming:
The programming language play an important role in making task easy for people.
Learning programming can give you a competitive edge in the technology or computer
technology.
Learning programming helps you to develop a successful carrier .
Problem :
A problem is a situation, hurdle , a question or any think that cause difficulties. In other
word we can say it is a task which required a solution. Problem can be solved with the help of
computer programming.
Problem solving Process :
Problem solving is a step by step process . we can classified in five steps are as follow .
1. Defining the problem
2. Planning the solution
3. Coding the programming
4. Testing the program
5. Documenting the program
Defining The Problem :
This is the first and most difficult step. In this step we identify , describe and understand
the problem .clear understanding of problem is very necessary. Defining the problem required
that the programmer specify four mini task. They are 1) determining the program objective. 2)
Determining the desire output. 3) Determining the input data. 4) Determining the processing
requirement.
Planning the Solution :
In this step plan a solution of a problem and we developed a list of feasible solution that
can be decided which one is the best for it. The programmer is supposed to plan a solution using
program design tools. These techniques consist of the following:
1. Top to down program design 2. Algorithm and 3. Flowchart
Top – Down program design :
A top-down design is the decomposition of a program. Top down design is breaking a
problem down into increasingly smaller and smaller manageable elements or step. As soon as
Page 2
Prepared by : Sir Noman Khan class XII
these basic elements are identified, it is easier to build these elements as computer modules.
Once the modules are built, it is effortless to put them together, building the whole system from
these individual elements .Such steps or elements are called program modules.
Algorithm :
An algorithm is a finite sequence of unambiguous instruction design to solve particular
problem and instructions. In other word we can say it is a set of instruction /step / rules which are
followed to solve a problem.
Flowchart:
Flowchart is a pictorial representation of logic used in a computer programming. We can
also said that flowchart is a planning technique used in program .a flowchart representing a
different symbols containing information about step of sequence and events .
Coding the Program :
Coding is the process of writing codes or instruction in a programming language. Coding
requires basic knowledge of programming skills without any software tools. The language used
depend on the system resources available, the expertise of the programmer and the type of
application .
Testing the Program :
Once the program has been coded completely the next step is the implementation. The
testing phase make sure the program fulfills all the objective which is required for the user. It the
most frustrating stage in the program development process. In this phase many errors are accrue
and have to remove, make sure that the program performed the intended task.
Errors / Bugs :
The faults occur in a program is called error it is a testing phase in programming
language where we cheek errors in program . programming errors are known as Bugs.
In general , there are three type of errors.
1. Syntax error
2. Logic error
3. Runtime error
Syntax Error :
Syntax error is a violation of rules of the programming language. They are often caused by
typing mistakes such as misspelled , keywords , missing brackets and missing parenthesis etc.
Logic Errors :
The logical error is an error in planning the program’s logic .on compilation and execution
of a program desire output is not obtained when certain input values are given this type of errors
which provides incorrect output but appear to be error free are called logical error .
Runtime Error :
Runtime error refers to an error that takes place while executing a program. these issues
cannot be caught at compile-time.
Page 3
Prepared by : Sir Noman Khan class XII
Page 4
Prepared by : Sir Noman Khan class XII
Page 5
Prepared by : Sir Noman Khan class XII
3. FORTRAN programming develop for one type of computer but easily modified to work
on other types.
Disadvantages:
1. It cannot handle IO operations to storage devices as other high level languages.
2. It has limited ability to express and process nonnumeric data.
3. It is not easy to read and understand
COBOL:
COBOL is a compiled English-like computer programming language designed for
business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL
stands for Common Business Oriented Language. It is imperative, procedural, and object-
oriented. A compiler is a computer program that takes other computer programs written in a
high-level (source) language and coverts them into another program, machine code, which the
computer can understand.
Advantages :
1. It is machine independent
2. It is easy to understand.
3. It can handle many file records and fields.
4. It easily handle IO operations .
Disadvantages :
1. Codes are lengthy and programmer productivity is slowed.
2. It cannot handle mathematical processing.
BASIC :
BASIC (Beginners' All-purpose Symbolic Instruction Code)[1] is a family of general-
purpose, high-level programming languages designed for ease of use. BASIC continues to be
widely used because it can be learned quickly, its statements are easy to read by other
programmers, and support is available on most operating systems (OS).
Advantages :
1. It is easy to use.
Disadvantages :
1. Its processing speed is slow.
2. It is not a portable language .
Pascal :
Pascal is a general-purpose, high-level language that was originally developed by Niklaus
Wirth in the early 1970s. Pascal offers several data types and programming structures. It is easy
to understand and maintain the Pascal programs.
Advantages :
1. Pascal is a strongly typed language.
2. It offers extensive error checking.
3. It offers several data types like arrays, records, files and sets.
Page 6
Prepared by : Sir Noman Khan class XII
Page 7
Prepared by : Sir Noman Khan class XII
because it can be used to do low-level programming (for example driver and kernel). It is
generally used to create hardware devices, OS, drivers, kernels, etc. For example, Linux kernel is
written in C. It can't be used for internet programming like Java, .Net, PHP, etc.
Features :
1. C is intended to do low-level programming. It is used to develop system applications
such as kernel, driver, etc. It also supports the features of a high-level language. That is
why it is known as mid-level language.
2. C is a simple language in the sense that it provides a structured approach (to break the
problem into parts), the rich set of library functions, data types, etc.
3. C is a machine independent language.
4. we can break the program into parts using functions. So, it is easy to understand and
modify. Functions also provide code reusability.
5. It supports the feature of dynamic memory allocation.
6. C language is extensible because it can easily adopt new features.
Advantages :
1. C work well with microprocessor
2. It has a high degree of portability
3. It is fast and efficient
Disadvantages :
1. C is consider difficult to learn
2. Code can be difficult to follow
3. it does not support the concept of OOPs (Inheritance, Polymorphism, Encapsulation,
Abstraction, Data Hiding). C simply follows the procedural programming approach.
Page 8
Prepared by : Sir Noman Khan class XII
Page 9
Prepared by : Sir Noman Khan class XII
Page
10