[go: up one dir, main page]

0% found this document useful (0 votes)
17 views12 pages

PART 2

The document provides an overview of computer systems, detailing the components of hardware and software, including system software (operating systems and language processors) and application software (packages, utilities, and business software). It also discusses programming languages from machine language to high-level languages, including their advantages and disadvantages, as well as concepts like algorithms, flowcharts, and debugging tools. The document emphasizes the importance of understanding programming concepts and methodologies for effective problem-solving in computing.

Uploaded by

Sampurna prusty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views12 pages

PART 2

The document provides an overview of computer systems, detailing the components of hardware and software, including system software (operating systems and language processors) and application software (packages, utilities, and business software). It also discusses programming languages from machine language to high-level languages, including their advantages and disadvantages, as well as concepts like algorithms, flowcharts, and debugging tools. The document emphasizes the importance of understanding programming concepts and methodologies for effective problem-solving in computing.

Uploaded by

Sampurna prusty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

INTRODUCTION TO PROGRAMMING

A computer system consists of hardware & software for its functioning.


Hardware:
➢ It represents the physical and tangible components of a computer system i.e., the
components that can be seen and touched.
➢ Eg: Input devices, Output devices, CPU, Floppy Disk . . . . . .
Software:
➢ It represents the set of programs that govern the operation of a computer system and
make the hardware to function.
➢ Software can be classified broadly into two categories, mainly
o System Software
o Application Software
System Software:
➢ The Software that controls internal computer operations is called system software.
➢ Eg: Some of the internal computer operations are reading data from input devices,
transmitting processed information to the output devices, converting data to computer
understandable format.
➢ The system software can be further classified into two categories.
o Operating System
o Language Processor
Operating System: {OS}
➢ An operating system is a program which acts as an interface between a user and
hardware i.e. all computer resources.
➢ Operating system itself decides “how to do” “what to do” and “when to do” about a
particular operation.
➢ The primary goal of an operating system is to make the computer system convenient to
use and secondary goal is to use computer hardware in an efficient manner.
➢ An operating system is an important component of a computer system which controls all
other components of the computer system.
Language Processors:
➢ As programmer prefer to write their programs in one of the High Level Languages {HLL}
because it is much easier to understand the code easily.
➢ However, the computer doesn’t understand any language other than “Binary Language.”
It becomes necessary to process a HLL program me so as to make it understandable to
the computer.
➢ The system program which performs the above job is called language processors.
➢ Assembler, Interpreter and Compliers are some of the language processors.

Application Software:
➢ An Application Software is a set of programmers necessary to carry out operations for a
specified application.
➢ These are the programmers written by programmers to enable computer perform
specific task.
➢ Application software can be further sub-divided in to 3 categories.
o Packages
o Utilities
o Business Software

Packages:
➢ Packages are general purpose application software. This software’s has been written to
do almost every task that is commonly used in various organizations. Some major
packages are Word Processing System, Spread sheets, graphics, multimedia. . . . .
Utilities:
➢ These are application programs that help the computer by performing housekeeping
functions like backup, scanning virus, disk de-fragmentation, etc.
➢ These are helpful programs that ensure the smooth functioning of the computer.
Business Software:
➢ This type of software is developed based on requirements of a particular business.
➢ Examples are Inventory Management System, Railway Reservation System, and Hospital
Management System. . . . .

Programming Language:
➢ A computer follows the instructions given by the programmer to perform a specific job.
To perform a task programmer prepares a sequence of instructions known as program.
➢ A program written for a computer is known as software.
➢ The program is stored in RAM. The cpu takes one instruction at a time from RAM &
executes it. The instructions are executed by one by one in sequence and finally produce
the desired result.
➢ The journey of computer software programming starts with Machine Language,
Assembly Language, and High-Level Language.

Compiler or Interpreter
➢ The code in a source file stored on the disk must be translated into machine language.
This is the job of the translator.
➢ Compiler and interpreters are translators. Compiler compiles the entire program at
once where as the interpreter interprets the program line by line.
➢ The translator reads the program and writes the resulting object module to a file that
can then be combined with other precompiled units to form the final program.
Linker
➢ A program is made up of many functions. We write some of these functions, and they are
a part of our source program.
➢ However, there are other functions, such as input/output processes and mathematical
library functions that exist elsewhere and must be attached to our program.
➢ The linker assembles all of these functions into final executable program.

Loader
➢ Once our program has been linked, it is ready for execution.
➢ To execute a program, we use an operating system command, such as run, to load the
program into primary memory and execute it.
➢ Getting the program into memory is the function of an operating system program knows
as the loader.
➢ It locates the executable program and reads it into memory. When everything is loaded,
the program takes control and it begins execution.
➢ In today’s integrated development environment, these steps are combined under one
mouse click or pull-down window.
Debugger
➢ A debugger or debugging tool is a computer program that is used to test and debug
other programs.
➢ Debuggers also offer more sophisticated functions such as running a program step by
step (single-stepping or program animation), stopping (breaking) (pausing the program
to examine the current state) at some event or specified instruction by means of a
breakpoint, and tracking the values of variables.
➢ Some debuggers have the ability to modify program state while it is running.
➢ It may also be possible to continue execution at a different location in the program to
bypass a crash or logical error.

I Generation Programming Languages (Machine Language):


➢ When the human being started programming, the instructions were given to the
computer in a language that it can understand.
➢ The computer understands only one language that is Binary language. The language of
1’s & 0’s is known as Binary language and it is also known as Machine Language.
➢ Any instruction in this language is given in the form of string of 1’s & 0’s. Where the
symbol ‘1’ stands for presence of electric pulse & 0 stands for absence of electric pulse.
➢ A set of 1’s & 0’s has a specific meaning to a computer even though it appears as a
binary numbers.

Disadvantages:
➢ The writing of a program in machine language is very difficult and complicated.
➢ It was accomplished by experts only.
➢ All the instructions and data are to be entered in to the computer in numeric form only
{Binary form}.
➢ It requires the knowledge of complete computer circuitry.
➢ Debugging is a tedious job. { time taking job}
➢ Because of these reasons the machine language never became popular among the users.

II Generation Programming Languages (Assembly Language) :


➢ The first language similar to English was developed in 1950. Which was known as
Assembly Language (or) Symbolic programming language?
➢ In these Assembly languages operations are performed by using special symbols known
as “MNEMONICS” which are easier to remember.
➢ In case of Assembly level language the programmer need not to keep track of memory
locations.
➢ The writing of assembly language is easier than machine Language.
➢ Eg: In order to add 2 numbers A & B. The following instructions are written.
CDA A.
ADD B.
➢ The first instruction means the A value added in to accumulator and the second is to add
the contents of accumulator to B and store the result in accumulator.
➢ The important purpose of this language is to bring the man and machine very near to
each other.

Disadvantages:
➢ Before writing a program in assembly language, the Assembler must be loaded in to the
computer memory which occupies a sizable memory of computer. It can’t be used with
small capacity computers.
➢ The execution of assembly language program takes more time compared to equivalent
machine language program.
➢ There is no standardization of Assembly language. Each manufacturer develops is own
Assembly program. Therefore, the program written in Assembly language for one
computer can’t be used for another computer.

Assembler:
➢ The code written by the user in order to perform a task is called source code.
➢ The source code can’t be understood by computer. Computer can understand only
machine language code i.e., 0’s & 1’s. The code understood by the computer is called
object code.
➢ The software which converts source code to object code is called “Translator”.
➢ In order to convert an Assembly level language code in to object code we use a
translator called “Assembler”.
➢ Assembler: It is a Translator which converts Assembly level language code to Machine
language code.
III Generation Programming Languages (High Level Language):
➢ Even though the Assembly Language proved to be a great help to the programmer, still
a search was continued for better languages which is like an English language.
➢ The languages developed which were nearer to the English language for writing the
programs in 1960 were known as “High level languages”.
➢ The development of high level languages was very rapid because of the common man
can use it without much trouble.

Advantages:
➢ They are easy to learn and use.
➢ It doesn’t require any background of computer. Hardware as such they can be learned by
an ordinary man.
➢ They can easily be documented.
➢ These languages are portable because we can run these programs on any computer can’t
run on another computer. This is the most advantage of High level language.
➢ The modifications in the program can be easily made.
➢ The programs written by using these languages are independent of structure of the
program.

Disadvantages:
➢ One has to learn the special rules for writing programs in a particular High level
language.
➢ The operation speed is slow when compared to the operation time in machine language.
➢ A High level language program occupies a large memory.
➢ Extensive Hardware support is required.

IV Generation Programming Languages (4GL’s):


➢ The 3GL’s are procedural in nature i.e., these languages specify “ how to do ”.Hence 3GL’s
require the knowledge of complete steps to solve a problem.
➢ In case of 4GL’s, they are non-procedural i.e., they specify “ what to do ” . Hence in 4GL’s
we need to specify only what we required and rest gets done on its own

Advantages:
➢ Smaller code
➢ Reduced development time and maintenance cost
➢ Easy to programmers
➢ Doesn’t require a high knowledge on program

GUI Based Languages


➢ With the invention of GUI based interfaces, many programming languages are developed
that help programmer to develop GUI applications.
➢ Some of the GUI based languages are
▪ Visual Basic(VB)
▪ C#
▪ VB.Net

ALGORITHM
Algorithm is a very popular technique used to obtain solution for a given problem.
Definition: - An algorithm is defined as a finite set of steps that provide a chain of actions
for solving a problem.
Procedure for writing an algorithm:-
An Algorithm is a well organized and textual computational module that
receives one or more input values and provides one or more output values.
• These well defined steps are arranged in a sequence that processes given input into
output.
• The steps of the algorithm are written using English like statements which are easy to
understand.
• This will enable the reader to translate each step into a program.
• Every step is known as instruction.
• An algorithm is set to be accurate only when it provides the exact required output.
• If the procedure is lengthy then sub divided the procedure into small parts as it make
easy to solve the problem.

Analyzing an Algorithm:-
When one writes an algorithm, it is essential to know how to analyses the algorithm.
• Analyzing the algorithm refers to calculating the resources such as computer memory,
processing time, logic gates and so on …..
• Time is most important resource because the program developed should be faster in
processing.
• The analysis can also be made by reading the algorithm for logical accuracy, tracing
the algorithm and checking with the data.
• An efficient algorithm must be developed utilizing minimum system resources such as
cpu time and memory.
• Timing analysis depends up on the input required.

Categories of Algorithm
The steps in an algorithm can be divided into three categories, namely
➢ Sequence
➢ Selection and
➢ Iteration
Sequence
➢ The steps described in an algorithm are performed successively one by one without
skipping any step.
➢ The sequence of steps defined in an algorithm should be simple and easy to understand.
➢ Each instruction of such an algorithm is executed, because no selection procedure or
conditional branching exists in a sequence algorithm.
Example:
// adding two timings
Step 1: start
Step 2: read h1, m1, h2, m2
Step 3: m=m1+m2
Step 4: h= h1 + h2 + m/60
Step 5: m=m mod 60
Step 6: write him
Step 7: stop
Selection
➢ We understand that the algorithms written in sequence fashion are not reliable. There
must be a procedure to handle operation failure occurring during execution.
➢ The selection of statements can be shown as follows
if(condition)
Statement-1;
else
Statement-2;
➢ The above syntax specifies that if the condition is true , statement-1 will be executed
otherwise statement-2 will be executed.

➢ In case the operation is unsuccessful. Then sequence of algorithm should be changed/


corrected in such a way that the system will re-execute until the operation is successful.
Example:
// Person eligibility for vote
Step 1 : start
Step 2 : read age
Step 3 : if age > = 18 then step_4 else step_5
Step 4 : write “person is eligible for vote”
Step 5 : write “ person is not eligible for vote”
Step 6 : stop
Multi-way:
For a single problem, three may be multiple solutions. In such a situation we have to apply
multi way (switch case) decision statements or we can extend two-way statements (example,
if else) in a ladder form.
Example:
// Roots of a quadratic Equation
Step 1 : start
Step 2 : read a,b,c
Step 3 : if (a= 0) then step 4 else step 5
Step 4 : Write “ Given equation is a linear equation “
Step 5 : d=(b * b) _ (4 *a *c)
Step 6 : if ( d>0) then step 7 else step8
Step 7 : Write “ Roots are real and Distinct”
Step 8: if(d=0) then step 9 else step 10
Step 9: Write “Roots are real and equal”
Step 10: Write “ Roots are Imaginary”
Step 11: stop

Iteration
➢ In a program, sometimes it is very necessary to perform the same action for a number of
times.
➢ If the same statement is written repetitively, it will increase the program code.
➢ To avoid this problem, iteration mechanism is applied.
➢ The statement written in an iteration block is executed for a given number of times based
on certain condition.
Example:
Step 1 : start
Step 2 : read n
Step 3 : repeat step 4 until n>0
Step 4 : (a) r=n mod 10
(b) s=s+r
(c) n=n/10
Step 5 : write s
Step 6 : stop

FLOWCHART
Introduction:-
A flowchart is an alternative technique for solving a problem. Instead of
descriptive steps, we use pictorial representation for every step.
Definition:-
Flowchart is a diagrammatic or graphical or pictorial representation of various steps
involved I the solution of the problem.
• A complete flowchart enables us to organize the problem into a plan of actions i.e. it
specifies what comes first, second, third . . . .
• Flowchart also represents the flow of data.
• The designer draws the flowchart for designing the product.
• It is a working map of the final product.
• It is an easy way to solve the complex problems because it makes the reader to flow
the process quickly from the flowchart incited of going through text.
• A flowchart is a set of symbols that indicates various operations in a program.
• For every process there is a corresponding symbol in the flowchart.
• Once the algorithm is written, its pictorial representation can be done using flowchart
symbol.
• Some of the commonly used flowchart symbols are listed below.

Symbol Description Symbol Description

Start/Stop
Card

Decision
Summing Junction

Connector
OR

Process
Collate

Input/output
Sort

Loop Extract

Data Flow Direction


Merge
Lines

Predefined Process Off-page Connector

Internal Storage Stored Data

Sequential Access
Process delay
Storage
Direct Access
Manual Input
Storage

Alternative Process Display

Manual Operation Magnetic Disk

Punched Tape Document

SOFTWARE DEVELOPMENT METHOD


Introduction:-
A Disciplined approach is essential to create programs that are easy to read,
understand and maintains.
➢ Programming is a problem-solving activity.
➢ Programmers use a methodology to solve the program and that methodology is
referred to as software development method.
Steps in software development method:-
The software development method includes the following steps.
i) Problem specification
ii) Analysis
iii) Design
iv) Implementation
v) Testing
vi) Maintenance
Problem specification:-
➢ It specifies the state of the problem clearly and without any ambiguity.
➢ This step helps us to gain a clear understanding of what is required for solving the
existing problem and to find its solution.
Analysis:-
➢ This step involves identifying three important elements of a problem namely
• Problem input i.e. the data that we have to work or process.
• Problem output i.e. the result that we have to work or process.
• Any additional requirements or constraints on the solution.
➢ At this stage we should also determine the required formal in which the results should
be displayed.
➢ We should also develop a list of problem variables and their relationships.
➢ This process of extracting essential variables and their relationships is known as
abstraction.
Design:-
➢ Designing makes to solve the problem by developing a list of steps called algorithm.
➢ Writing the algorithm is the most important part of problem solving.
➢ We generally use top-down design (also called divide and conquer) approach i.e.
divide the problems into sub problems.
➢ Most computer algorithms contain three basic steps.
▪ Get the data
▪ Perform the computation
▪ Display the results
➢ Once we know the algorithm we can perform algorithm refinement.
➢ Algorithm refinement is the development of a list of steps to solve a particular step in
the original algorithm.
➢ Then we can represent algorithm in a pictorial representation by using flow chart.
Coding (or) implementation:-
➢ Implementing the algorithm involves writing a program in a particular language.
➢ We must convert each algorithm step into one are more statement in a programming
language.
Testing:-
➢ Testing & verifying the program requires testing the completed program to verify that
it works as desired.
➢ In testing we run the program several types using different sets of data to make sure
that it works correctly for every situation.
Maintenance:-
Maintaining and updating the problem involves modifying a program to keep it
up to date as per company policy changes.
Important points:-
➢ Booting:-
Booting is a process by which the operating system is loaded into the memory. There
are two types of booting
• Cold booting
• Warm booting
Cold booting:-
To load operating system into the computer memory by switching on the computer is
called cold booting. BIOS checking will be performed during this booting.
Warm Booting:-
➢ System can be rebooted by pressing Ctrl+Alt+Del simultaneously. Here BIOS
checking is not required.
➢ Soft copy and Hard Copy:-
Softcopy means getting the data in a memory device like CD ,Pen Drive ,DVD etc.
Whereas hard copy means getting the data in a paper.

➢ Functions of operating System:-


• CPU Scheduling
• File Management
• Input/Output Management
• Memory Management
• Job Scheduling
• Data Security
• Error Detection
• Resource Allocation.
➢ Types of Operating System:-
• Single program OS
• Batch processing
• Multi-programming
• Time-sharing
• Multi-Processing
• Distributed Systems
• Real-time systems.
➢ CUI-Character User Interface. Ex:- DOS
➢ GUI- Graphical User Interface. Ex:-Windows
➢ Format:- Formatting is a process of dividing memory device into tracks and sectors.
➢ Memory Measurement Units:-
o 1 bit= 0 or 1
o 2 bits = 1 dibit
o 4 bits = 1 nibble
o 8 bits = 1 byte
o 1024 bytes = 1 kilo byte(1 KB)
o 1024 KB = 1 Mega Byte (1 MB)
o 1024 MB = 1 Giga Byte (1 GB)
o 1024 GB = 1 Tera Byte(1 TB)
o 1024 TB = 1 Peta Byte(1PB)
o 1024 PB = 1 Exa Byte(1 XB)
o 1024 XB = 1 Zetta Byte (1 ZB)
o 1024 ZB = 1 Yotta Byte(1 YB)
o 1024 YB = 1 Brono Byte(1 BB)
o 1024 BB = 1 Geop Byte

You might also like