0% found this document useful (0 votes)
3 views9 pages

PPSUnit 1IntroductiontoProgramming

The document outlines key concepts in programming, including the differences between hardware and software, compilers and interpreters, and types of language processors. It also defines system software and application software, as well as flowcharts and algorithms, highlighting their characteristics and differences. Additionally, it provides examples and references for further understanding.

Uploaded by

250860131050
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)
3 views9 pages

PPSUnit 1IntroductiontoProgramming

The document outlines key concepts in programming, including the differences between hardware and software, compilers and interpreters, and types of language processors. It also defines system software and application software, as well as flowcharts and algorithms, highlighting their characteristics and differences. Additionally, it provides examples and references for further understanding.

Uploaded by

250860131050
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

Programming for Problem Solving (BE01R000121) Prof.

Hem V Nayak

UNIT - 1 INTRODUCTION TO PROGRAMMING



DIFFERENCE BETWEEN HARDWARE & SOFTWARE

Parameters Hardware Software

Basic Definition Hardware is the physical Software is the set of


part of the computer that instructions that tells the

K
processes the data. computers what to do.

Development It is manufactured It is designed and

A
engineered

AY
Tangible It is tangible in nature as It is not tangible in nature
we can touch and as we can use softwares
physically feel it but cannot touch it.

Virus Effect Hardware is not affected Software can get affected


N
by any kind of virus by viruses.

Transfer We cannot transfer the We can transfer or share


V

hardware from one place the software via network


to another place means.
electrically through the
EM

network.

Replacement It can be replaced with If software is damaged its


any working hardware backup copy can be
reinstalled.
H

Processing of Creating Electronics and other Programming languages


materials are used to and a set of instructions
create hardware devices are executed for any
development of
softwares.

Examples Keyboard, Mouse, MS Excel, MS Word,

Laxmi Institute of Technology, Sarigam IT & CSE Department


Programming for Problem Solving (BE01R000121) Prof. Hem V Nayak

Speaker, Printer, etc. PowerPoint, MySQL,

DIFFERENCE BETWEEN COMPILER & INTERPRETER

The compiler saves the Machine The Interpreter does not save the
Language in the form of Machine Code Machine Language
on disks.

K
Compiled codes run faster than Interpreted codes run slower than
Interpreter. Compilers.

A
The compiler generates an output in the The interpreter does not generate any

AY
form of (.exe). output.

Errors are displayed in Compiler after Errors are displayed in every single
Compiling together at the current time. line.
N
It does not require source code for later It requires source code for later
execution. execution.

Compilers more often take a large In comparison, interpreters take less


V

amount of time for analyzing the source time for analyzing the source code.
code.
EM

CPU utilization is more in the case of a CPU utilization is less in the case of an
Compiler. Interpreter.

The use of Compilers mostly happens The use of Interpreters is mostly in


in Production Environment. Programming and Development
H

Environments.

Object code is permanently saved for No object code is saved for future use.
future use.

C, C++, C#, etc are programming Python, Ruby, Perl, SNOBOL,


languages that are compiler-based. MATLAB, etc are programming
languages that are interpreter-based.

Laxmi Institute of Technology, Sarigam IT & CSE Department


Programming for Problem Solving (BE01R000121) Prof. Hem V Nayak

TYPES OF LANGUAGE PROCESSORS


The language processors can be any of the following three types:

1. Compiler

The language processor that reads the complete source program written in

K
high-level language as a whole in one go and translates it into an equivalent
program in machine language is called a Compiler. Example: C, C++, C#.

A
In a compiler, the source code is translated to object code successfully if it is free
of errors. The compiler specifies the errors at the end of the compilation with line

AY
numbers when there are any errors in the source code. The errors must be removed
before the compiler can successfully recompile the source code again; the object
program can be executed a number of times without translating it again.
N
V
EM

2. Assembler

The Assembler is used to translate the program written in Assembly language into
machine code. The source program is an input of an assembler that contains
H

assembly language instructions. The output generated by the assembler is the


object code or machine code understandable by the computer.
Assembler is basically the 1st interface that is able to communicate humans with
the machine. We need an assembler to fill the gap between human and machine so
that they can communicate with each other. Code written in assembly language is
some sort of mnemonics(instructions) like ADD, MUL, MUX, SUB, DIV, MOV

Laxmi Institute of Technology, Sarigam IT & CSE Department


Programming for Problem Solving (BE01R000121) Prof. Hem V Nayak

and so on. and the assembler is basically able to convert these mnemonics in binary
code. Here, these mnemonics also depend upon the architecture of the machine.
For example, the architecture of intel 8085 and intel 8086 are different.​

K
A
AY
3. Interpreter

The translation of a single statement of the source program into machine code is
done by a language processor and executes immediately before moving on to the
N
next line is called an interpreter. If there is an error in the statement, the interpreter
terminates its translating process at that statement and displays an error message.
The interpreter moves on to the next line for execution only after the removal of
V

the error. An Interpreter directly executes instructions written in a programming or


scripting language without previously converting them to an object code or
machine code. An interpreter translates one line at a time and then executes it.
EM

Example: Perl, Python and Matlab.


H

Laxmi Institute of Technology, Sarigam IT & CSE Department


Programming for Problem Solving (BE01R000121) Prof. Hem V Nayak

REFERENCES:
[Link]
rs-assembler-compiler-and-interpreter/

WHAT IS SYSTEM SOFTWARE AND APPLICATION SOFTWARE


K
System software runs the computer and hardware (like an OS), while application
software performs specific user tasks (like a browser or game); the key difference
is that system software is foundational, managing resources for applications, which

A
are user-facing tools built on top of the system software.

AY
Examples:
System Software: Windows, macOS, Linux, device drivers.
Application Software: Microsoft Word, Chrome, Photoshop, WhatsApp, games.
N
System Software
●​ Purpose: Manages computer hardware and provides a platform for
V

applications to run.
●​ Function: Controls basic functions like memory, storage, and device
communication, operating in the background.
EM

●​ Examples:
○​ Operating Systems (OS): Windows, macOS, Android, Linux.
○​ Utilities: Antivirus software, disk defragmenters, backup tools.
○​ Drivers: Software that lets the OS communicate with hardware (e.g.,
printer, graphics card).
H

Application Software
●​ Purpose: Performs specific tasks or functions for the end-user.
●​ Function: Directly interacts with the user to help them achieve goals (e.g.,
writing, browsing, calculating).

Laxmi Institute of Technology, Sarigam IT & CSE Department


Programming for Problem Solving (BE01R000121) Prof. Hem V Nayak

●​ Examples:
○​ Productivity: Microsoft Office (Word, Excel), Google Docs.
○​ Web Browsers: Chrome, Firefox, Safari.
○​ Entertainment: Video games, VLC Media Player, Spotify.
○​ Creative: Adobe Photoshop, Illustrator.

K
A
AY
N
V
EM

DEFINE FLOWCHART

Flowchart is the graphical or the pictorial (diagrammatic) representation of any


procedure or an algorithm. There are certain components or elements of flowchart. ​
H

Flowcharts use symbols/shapes like arrows, rectangles, and diamonds to properly


explain the sequence of steps involved in the algorithm or process. Flowcharts
have their use cases in various fields such as software development, business
process modeling, and engineering.​

Laxmi Institute of Technology, Sarigam IT & CSE Department


Programming for Problem Solving (BE01R000121) Prof. Hem V Nayak

K
A
AY
N
V
EM

DEFINE ALGORITHM ​

The word Algorithm means “a process or set of rules to be followed in calculations


H

or other problem-solving operations”. Therefore Algorithm refers to a set of


rules/instructions that step-by-step define how a work is to be executed in order to
get the expected results.​

Properties of algorithm ​
1. The algorithm is complex to understand.​
2. In the algorithm, plain text is used.
Laxmi Institute of Technology, Sarigam IT & CSE Department
Programming for Problem Solving (BE01R000121) Prof. Hem V Nayak

3. The algorithm does not follow any rules.


4. The algorithm is the pseudo-code for the program.
5. The algorithm is easy to debug.

An algorithm is a precise, step-by-step set of instructions to solve a problem,


characterized by several key features that ensure its reliability and functionality.

The primary characteristics of an algorithm include:

K
●​ Input: An algorithm must have zero or more well-defined initial values, or

A
inputs, to work on.
●​ Output: An algorithm must produce one or more specified results, or

AY
outputs, that have a clear relation to the inputs.
●​ Definiteness (Unambiguity): Each step of the algorithm must be clear,
precise, and unambiguous. There should be only one interpretation of each
N
instruction, with no room for confusion.
●​ Finiteness: An algorithm must terminate after a finite number of steps and
V

within a reasonable amount of time. It should not enter into an infinite loop.
●​ Effectiveness: Each step must be simple, feasible, and practically executable
EM

with the available resources. The operations should be basic enough that
they can, in principle, be done exactly and in a finite length of time.
●​ Language Independence: An algorithm is a conceptual guide and should be
expressed in a way (like pseudocode or a flowchart) that is independent of
H

any specific programming language.

Laxmi Institute of Technology, Sarigam IT & CSE Department


Programming for Problem Solving (BE01R000121) Prof. Hem V Nayak

DIFFERENCE BETWEEN FLOWCHART AND ALGORITHM

FLOWCHART ALGORITHM
Flowchart is the pictorial or graphically An algorithm is the execution of a procedure
(diagrammatic) representation of an or the certain instructions for completion of
algorithm any particular task.
Easy to represent branching and looping Difficult to represent branching and looping

K
Easy to understand Difficult to understand
Various types of symbols are used Certain steps are used to write an algorithm

A
More easier even for non-technical person to Difficult for non-technical person to

AY
understand understand
Can be applicable only for small problems Can be applicable for huge and complex
problem statements
Example of Flowchart: Example of Algorithm:
N
Step 1: Start
Step 2: Read input as num1 and num2 ​
V

Step 3: Check Condition ​


If num1>num2 goto step 5 ​
Step 4: Print “num1 is greater” ​
EM

Step 5: Print “num2 is greater” ​


Step 6: Stop
H

Laxmi Institute of Technology, Sarigam IT & CSE Department

You might also like