0% found this document useful (0 votes)
31 views

Chapter 1

Uploaded by

soullyykeos
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Chapter 1

Uploaded by

soullyykeos
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

22-23

COMPUTER STUDIES
CLASS 12TH NOTES

Chapter # 1
Concept of Computer Programming

Eng. Noman Khan


Cell# 0312228690
Class 12th
Prepared by : Sir Noman Khan class XII

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

The Debugging Process :


The process of deducting and correcting these errors is called debugging. Several tools
have been devised for finding removing errors , as follow
 Desk checking
 Manual testing with simple data
 Structured walkthrough
 Attempt at translation
 Testing sample data on the computer
 Run Real –World Data
Documenting The Program :
It is very essential phase of the programming process. The main purpose of program
documentation is to describe the design of your program. The documentation also provides the
framework in which to place the code. as coding progresses, the code is inserted into the
framework already created by the program documentation. it is important for several different
kind of people like user , operators and programmers.
Programming Language :
computer programming language, any of various languages for expressing a set of
detailed instructions for a digital computer. A computer programming language is define as the
source of communication to the computer system which provide all the material to develop
program and consequently complete software. Programmer used languages to write code in high
level languages and this code compiled into a low level languages which is directly organized by
the computer hardware.
High-level language uses format or language that is most familiar to users. The
instructions in this language are called codes or scripts. The computer needs a compiler and
interpreter to convert high-level language program to machine level language. Examples include
C++, Python, Java, etc. It is easy to write a program using high level language and is less time-
consuming. Debugging is also easy and is a human-readable language. High-level programming
language includes BASIC, C, Cobol, Perl, Pascal, LISP, FORTRAN, and Swift programming
language. Object Oriented Programming (OOP) language is derived from structured
programming and based upon the procedure call concept.
Characteristics of Programming Languages :
 A programming language must be simple, easy to learn and use, have good readability,
and be human recognizable.
 Abstraction is a must-have Characteristics for a programming language in which the
ability to define the complex structure and then its degree of usability comes.
 A portable programming language is always preferred.
 Programming language’s efficiency must be high so that it can be easily converted into a
machine code and executed consumes little space in memory.

Page 4
Prepared by : Sir Noman Khan class XII

 A programming language should be well structured and documented so that it is suitable


for application development.
 Necessary tools for the development, debugging, testing, maintenance of a program must
be provided by a programming language.
 A programming language should provide a single environment known as Integrated
Development Environment(IDE).
 A programming language must be consistent in terms of syntax and semantics.
Types of Programming Languages:
Programming languages are classified in to the following categories .
1. Low level language
2. Middle level language
3. High level language
Machine Language (Low Level Language):
Every creation of this universe has its own language. Like wise, computer has a
language that is called Machine Language ( machine level language ) for instructing
computer to perform s pacific task . It is also called binary language because it is the language
of 0s and 1s, means every instruction in Machine language consists of a series of 0s and 1s
(binary code) that a computer can understand and execute directly.
Middle level language :
To make computer program preparation easier and more efficient so the assembly
language is introduce which is known as middle language or assembly language.
Assembly Language :
In assembly language, the statements are written in symbolic codes ( termed
as mnemonics) that are easier for human to read and write as compared to machine
language assembly language statement corresponds to one machine language statement.
High level Language:
High level languages are closer to human languages than low-level language and
include statement like GOTO and PRINT which are regular words. High level programming
language is the set of current generation programming language .it is very similar to our
language .its is portable language and database supportive .it is non procedural and required less
effort .
Some Popular High Level Languages:
FORTRAN :
FORTRAN or FORmula TRANslator , was develop by IBM in 1954. It is a first high
level languages. Its widely used for mathematical , scientific and engineering problems.
FORTRAN has both advantages and disadvantages
Advantages :
1. It can handle complex and logical mathematical expression.
2. Its statement relatively short and simple

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

4. It offers a variety of programming structures.


5. It supports structured programming through functions and procedures.
6. It supports object oriented programming.
Disadvantages :
It has limited input / output programming capabilities.
PL /1 :
PL/I is a procedural, imperative computer programming language developed and
published by IBM. It is designed for scientific, engineering, business and system programming.
It has been used by academic, commercial and industrial organizations since it was introduced in
the 1964, and is still used.
Advantage :
It is most effective in organization that required both scientific and commercial
application.
Disadvantages :
It is difficult to learn
LOGO :
Logo is a programming language that is easy to learn. It is used for teaching students and
children how to program a computer. It was developed to process a list of words. A command is
an instruction, which the computer can understand and execute.
Advantages :
1. Enhances the logical sense of the children.
2. Develops programming skills.
3. It is real Computer Science.
Disadvantages:
1. It has a limited ability to express and process data.
Ada :
Ada is a structured, statically typed, imperative, and object-oriented high-
level programming language, extended from Pascal and other languages. it is developed by U.S
department of defence it is a successful commercial application
Advantages :
1. It is capable to a wide range of problem
2. Large program written in modules , compiled and tested easily
Disadvantages :
1. It has a high level of complexity and difficult to learn
2. Presently the number of machine that can compile Ada program are limited .
C: A portable language :
C is a general-purpose computer programming language. It was created in the 1970s by
Dennis Ritchie, and remains very widely used and influential. By design, C's features cleanly
reflect the capabilities of the targeted CPUs. C language is a system programming language

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

Object Oriented Programming :


Object-oriented programming OOP is a programming paradigm based on the concept of
"objects", which can contain data and code: data in the form of fields, and code, in the form of
procedures. A common feature of objects is that procedures are attached to them and can access
and modify the object's data fields.
Advantages of Object-Oriented Programming
1. Modularity for easier troubleshooting. When working with object-oriented programming
languages, you know exactly where to look when something goes wrong. ...
2. Reuse of code through inheritance. ...
3. Flexibility through polymorphism. ...
4. Effective problem solving.
Visual Programming :
Any language that uses the graphics or blocks that are already defined with the code and
you just need to use those blocks without worrying about the lines of code is known as a visual
programming language. In today’s era majority of the programming languages are text-based i.e.
we have to write the lines of code to perform the specific task like in C or C++. programming if
you want to print a table of 2 then you have to write the complete text using syntax and functions
of that language but in visual programming language this task is replaced by graphics or blocks
like components then can be joined logically to perform the task. Visual programming takes
OOP to next level
Advantages of visual programming language:
1. Easy to convert ideas into reality for example you don’t know how to code so you can
start with VPL(Visual Programming Language). and then switch to actual coding.
2. Visuals are easy to grasp i.e. to develop something in visual programming language
requires less efforts.
3. It includes a variety of built in objects that are required while creating something using
VPL.
4. It is a beginner-friendly also anyone will be able to derive the logic without worrying
about writing lines of code.
5. Adding a user-specific code is also available and simple as it allows to create of blocks as
per the convenience of the user.
Language translator:
Language translator is a method to translate high level programming language into
machine language before it can be execte so we need a language translter either compiler or
interpreter. Assembler is only use for middle level languageor assembly langyage
Compiler
A compiler is complex system software that automatically converts a program written in
some high-level language into an equivalent low-level machine language. The compiler or the
language processor converts the entire program into machine code before execution. A program

Page 9
Prepared by : Sir Noman Khan class XII

written by a programmer in a language other than machine language is called a Source


Program. Or The output from a compiler or an assembler, which consists of machine language
instructions, is called the Object Program.
Interpreter:
An interpreter is another type of translator that converts each statement of a
program written in a high level language into machine code and executes it before translating the
next statement of the source program. It differs from a compiler that translates the entire source
program into object program without undergoing its execution.
Assembler :
An assembler is a translator assembly language to machine language it is like a compiler
but interactive like an interpreter .

Page
10

You might also like