Principal Components of Fundamentals
Dr. M. Sudharsan 1
Structured Programming
 Structured Programming is a type of programming that generally converts large or complex programs into
more manageable and small pieces of code.
 These small pieces of codes are usually known as functions or modules or sub-programs of large complex
programs.
 It is known as modular programming and minimizes the chances of one function affecting another.
//C program to demonstrate the structured programming #include <stdio.h>
// Function for addition int sum(int a, int b)
{
return a + b;
}
// Function for Subtraction int sub(int a, int b)
{
return a - b;
}
Dr. M. Sudharsan 2
unstructured programming
• Unstructured Programming is a type of programming that generally executes in sequential order i.e., these programs just
not jumped from any line of code and each line gets executed sequentially.
• It is also known as non-structured programming that is capable of creating turning- complete algorithms.
// C program to demonstrate the unstructured programming #include <stdio.h>
int main()
{
// Variable initialization int a = 10, b = 5;
int add, minus;
// Operations performed add = a + b;
minus = a - b;
printf("Addition = %dn", add); printf("Subtraction = %dn", minus); return 0;
}
Dr. M. Sudharsan 3
OOPs
 Object-oriented programming (OOP) is a computer programming model that organizes software design
around data, or objects, rather than functions and logic.
 Object-Oriented Programming or OOPs refers to languages that use objects in programming. Object-
oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism etc.
 The main aim of OOP is to bind together the data and the functions that operate.
Dr. M. Sudharsan 4
Class:
A class is a user-defined data type-Collection of objects is called class. It is a logical entity. A class can also be
defined as a blueprint from which you can create an individual object. Class doesn't consume any space.
Example : Consider the Class of Cars. There may be many cars with different names and brands but all of them will share
some common properties like all of them will have 4 wheels, Speed Limit, Mileage range, etc.
Object:
Any entity that has state and behavior is known as an object. For example, a chair, pen, table, keyboard, bike, etc. It can be
physical or logical. An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is created
object memory is allocated.
Dr. M. Sudharsan 5
• Data Abstraction-Data abstraction is one of the most essential and important features of object-oriented
programming. Providing only essential information about the data. Hiding internal details and showing
functionality is known as abstraction. For example phone call, we don't know the internal processing.
• Encapsulation: Encapsulation is defined as the wrapping up of data under a single unit. It is the mechanism
that binds together code and the data it manipulates. Binding (or wrapping)
• Inheritance: Inheritance is an important pillar of OOP(Object-Oriented Programming). It provides code
reusability. When one object acquires all the properties and behaviors of a parent object, it is known as
inheritance.
Dr. M. Sudharsan 6
• Polymorphism: The word polymorphism means having many forms. In simple words, we can define
polymorphism as the ability of a message to be displayed in more than one form.
• Example: A person at the same time can have different characteristics
• Dynamic Binding: dynamic binding, the code to be executed in response to the function call is decided at
runtime.
• Message Passing : It is a form of communication used in object-oriented programming as well as parallel
programming.
Dr. M. Sudharsan 7
Characteristics of a good program
 A program written using any of the programming language must have certain characteristics, which makes it a
good program. Some of the key characteristics of a good program are as follows:
I. The program should be well-written so that it is easily readable and structured.
II. The program should not have hard-coded input values. This implies that it should not be written to work for
a particular input value, but must be a general program (also called generic program) that accepts input from
the user.
III. The program should also be well-documented so that later the author or any other programmer can
understand the program.
IV. Since new and better operating systems keep coming up, a program must be designed to be portable, i.e.
with minimum dependence on a particular operating system.
Dr. M. Sudharsan 8
Types Of Programming Language
 A Programming Language consists of a set of vocabulary and grammatical rules, to express the
computations and tasks that the computer has to perform. Programming languages are used to write a
program, which controls the behavior of computer, codify the algorithms precisely, or enables the
human- computer interface.
 Each language has a unique set of keywords (words that it understands) and a special syntax for
organizing program instructions. The programming language should be understood, both by the
programmer (who is writing the program) and the computer.
 A computer understands the language of 0s and 1s, while the programmer is more comfortable with
English-like language. Programming Language usually refers to high-level languages like COBOL,
BASIC, FORTRAN, C, C++, Java etc.
Dr. M. Sudharsan 9
1. Machine Language
2. Assembly Language
3. Procedural Language
4. Natural Language
5. Visual Programming Language
6. Scripting Language
7. Hypertext markup Language
8. Extensible markup language
Dr. M. Sudharsan 10
Machine Language
• Machine language is the lowest-level programming language, consisting of binary code that
directly instructs a computer's central processing unit (CPU). Each instruction corresponds to a
specific operation that the CPU can perform.
• Machine language is essential for programming at the hardware level but is highly machine-
specific and challenging for humans to work with directly. It serves as the foundation for higher-
level programming languages, which are more human-readable and user-friendly.
• In x86 assembly language, the instruction "MOV AL, 42"
Dr. M. Sudharsan 11
Assembly Language
• An assembly language is a type of low-level programming language
that is intended to communicate directly with a computer's hardware.
Dr. M. Sudharsan 12
Procedural Language
• A procedural language is a type of computer programming language that specifies a series of well-structured
steps and procedures within its programming context to compose a program. It contains a systematic order of
statements, functions and commands to complete a computational task or program.
Dr. M. Sudharsan 13
Natural Language
• A natural language is a human language, such as English or Standard
Mandarin, as opposed to a constructed language, an artificial language,
a machine language, or the language of formal logic.
Dr. M. Sudharsan 14
Visual Programming Language
• A visual programming language (VPL) is a computer program that develops applications using
graphical components and figures.
• Applications of Visual Programming language:
• VPL can be used in multiple domains like multimedia, educational purpose, video games, automation.
Let’s see them in brief:
• Multimedia:- VPL helps users create multimedia without worrying about the real code or other
complex features. It narrows down to specific functions and with the help of those functions, multimedia
is created.
• Educational Purpose:-Scratch VPL, etc are used to help students in their projects and make them
familiar with the coding.
• VideoGames:-VPL helps to create the videogames without writing lines of codes Ex- Scratch VPL is
used to make videogames.
Dr. M. Sudharsan 15
Scripting Language
• A scripting language or script language is a programming language
that is used to manipulate, customize, and automate the facilities of
an existing system. Scripting languages are usually interpreted at
runtime rather than compiled.
Dr. M. Sudharsan 16
Hypertext markup Language
• What Is HyperText Markup Language (HTML)? HyperText Markup Language (HTML) is the set
of markup symbols or codes inserted into a file intended for display on the Internet. The markup
tells web browsers how to display a web page's words and images.
Dr. M. Sudharsan 17
Extensible markup language
• XML is a software- and hardware-independent tool for storing and transporting data.
• XML stands for eXtensible Markup Language
• XML is a markup language much like HTML
• XML was designed to store and transport data
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
Dr. M. Sudharsan 18
Features of a good programming language
A good programming language should possess several key features that make it effective, efficient, and user-friendly for developers.
Readability: Code written in the language should be easy to read and understand. Clean and clear syntax promotes maintainability and
collaboration among developers.
Writability: A good language should allow developers to express their ideas concisely and efficiently, reducing the amount of code needed to
perform tasks.
Reliability: Programs written in the language should produce consistent and predictable results, with minimal unexpected behavior or errors.
Portability: Code written in the language should be able to run on different platforms and systems without major modifications, promoting
cross-platform compatibility.
Scalability: The language should support the development of both small and large-scale applications, adapting to increasing complexities and
requirements.
Performance: It should allow developers to write efficient code, optimizing for speed and resource usage when necessary.
Abstraction: The language should provide abstractions and data structures that simplify complex tasks, enabling developers to focus on solving
problems rather than low-level details.
Security: The language should include built-in security features and practices to help prevent common vulnerabilities like buffer overflows and
injection attacks.
Tooling: A good programming language should have a rich ecosystem of development tools, including integrated development environments
(IDEs), debuggers, and testing frameworks.
Memory Management: Efficient memory management mechanisms, such as automatic memory allocation and garbage collection, can reduce
the risk of memory-related errors.
Debugging and Testing: The language should offer robust debugging and testing capabilities to help developers identify and rectify issues
during development.
Error Handling: Effective error handling mechanisms should be in place to allow developers to gracefully handle exceptions and errors.
Dr. M. Sudharsan 19
UNIT 3
• Software is a set of instructions, data or programs used to operate computers and execute specific
tasks. It is the opposite of hardware, which describes the physical aspects of a computer.
• The two main categories of software are application software and system software. An application
is software that fulfills a specific need or performs tasks
Dr. M. Sudharsan 20

PCCF Unit 2.pptx

  • 1.
    Principal Components ofFundamentals Dr. M. Sudharsan 1
  • 2.
    Structured Programming  StructuredProgramming is a type of programming that generally converts large or complex programs into more manageable and small pieces of code.  These small pieces of codes are usually known as functions or modules or sub-programs of large complex programs.  It is known as modular programming and minimizes the chances of one function affecting another. //C program to demonstrate the structured programming #include <stdio.h> // Function for addition int sum(int a, int b) { return a + b; } // Function for Subtraction int sub(int a, int b) { return a - b; } Dr. M. Sudharsan 2
  • 3.
    unstructured programming • UnstructuredProgramming is a type of programming that generally executes in sequential order i.e., these programs just not jumped from any line of code and each line gets executed sequentially. • It is also known as non-structured programming that is capable of creating turning- complete algorithms. // C program to demonstrate the unstructured programming #include <stdio.h> int main() { // Variable initialization int a = 10, b = 5; int add, minus; // Operations performed add = a + b; minus = a - b; printf("Addition = %dn", add); printf("Subtraction = %dn", minus); return 0; } Dr. M. Sudharsan 3
  • 4.
    OOPs  Object-oriented programming(OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic.  Object-Oriented Programming or OOPs refers to languages that use objects in programming. Object- oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism etc.  The main aim of OOP is to bind together the data and the functions that operate. Dr. M. Sudharsan 4
  • 5.
    Class: A class isa user-defined data type-Collection of objects is called class. It is a logical entity. A class can also be defined as a blueprint from which you can create an individual object. Class doesn't consume any space. Example : Consider the Class of Cars. There may be many cars with different names and brands but all of them will share some common properties like all of them will have 4 wheels, Speed Limit, Mileage range, etc. Object: Any entity that has state and behavior is known as an object. For example, a chair, pen, table, keyboard, bike, etc. It can be physical or logical. An Object is an instance of a Class. When a class is defined, no memory is allocated but when it is created object memory is allocated. Dr. M. Sudharsan 5
  • 6.
    • Data Abstraction-Dataabstraction is one of the most essential and important features of object-oriented programming. Providing only essential information about the data. Hiding internal details and showing functionality is known as abstraction. For example phone call, we don't know the internal processing. • Encapsulation: Encapsulation is defined as the wrapping up of data under a single unit. It is the mechanism that binds together code and the data it manipulates. Binding (or wrapping) • Inheritance: Inheritance is an important pillar of OOP(Object-Oriented Programming). It provides code reusability. When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. Dr. M. Sudharsan 6
  • 7.
    • Polymorphism: Theword polymorphism means having many forms. In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form. • Example: A person at the same time can have different characteristics • Dynamic Binding: dynamic binding, the code to be executed in response to the function call is decided at runtime. • Message Passing : It is a form of communication used in object-oriented programming as well as parallel programming. Dr. M. Sudharsan 7
  • 8.
    Characteristics of agood program  A program written using any of the programming language must have certain characteristics, which makes it a good program. Some of the key characteristics of a good program are as follows: I. The program should be well-written so that it is easily readable and structured. II. The program should not have hard-coded input values. This implies that it should not be written to work for a particular input value, but must be a general program (also called generic program) that accepts input from the user. III. The program should also be well-documented so that later the author or any other programmer can understand the program. IV. Since new and better operating systems keep coming up, a program must be designed to be portable, i.e. with minimum dependence on a particular operating system. Dr. M. Sudharsan 8
  • 9.
    Types Of ProgrammingLanguage  A Programming Language consists of a set of vocabulary and grammatical rules, to express the computations and tasks that the computer has to perform. Programming languages are used to write a program, which controls the behavior of computer, codify the algorithms precisely, or enables the human- computer interface.  Each language has a unique set of keywords (words that it understands) and a special syntax for organizing program instructions. The programming language should be understood, both by the programmer (who is writing the program) and the computer.  A computer understands the language of 0s and 1s, while the programmer is more comfortable with English-like language. Programming Language usually refers to high-level languages like COBOL, BASIC, FORTRAN, C, C++, Java etc. Dr. M. Sudharsan 9
  • 10.
    1. Machine Language 2.Assembly Language 3. Procedural Language 4. Natural Language 5. Visual Programming Language 6. Scripting Language 7. Hypertext markup Language 8. Extensible markup language Dr. M. Sudharsan 10
  • 11.
    Machine Language • Machinelanguage is the lowest-level programming language, consisting of binary code that directly instructs a computer's central processing unit (CPU). Each instruction corresponds to a specific operation that the CPU can perform. • Machine language is essential for programming at the hardware level but is highly machine- specific and challenging for humans to work with directly. It serves as the foundation for higher- level programming languages, which are more human-readable and user-friendly. • In x86 assembly language, the instruction "MOV AL, 42" Dr. M. Sudharsan 11
  • 12.
    Assembly Language • Anassembly language is a type of low-level programming language that is intended to communicate directly with a computer's hardware. Dr. M. Sudharsan 12
  • 13.
    Procedural Language • Aprocedural language is a type of computer programming language that specifies a series of well-structured steps and procedures within its programming context to compose a program. It contains a systematic order of statements, functions and commands to complete a computational task or program. Dr. M. Sudharsan 13
  • 14.
    Natural Language • Anatural language is a human language, such as English or Standard Mandarin, as opposed to a constructed language, an artificial language, a machine language, or the language of formal logic. Dr. M. Sudharsan 14
  • 15.
    Visual Programming Language •A visual programming language (VPL) is a computer program that develops applications using graphical components and figures. • Applications of Visual Programming language: • VPL can be used in multiple domains like multimedia, educational purpose, video games, automation. Let’s see them in brief: • Multimedia:- VPL helps users create multimedia without worrying about the real code or other complex features. It narrows down to specific functions and with the help of those functions, multimedia is created. • Educational Purpose:-Scratch VPL, etc are used to help students in their projects and make them familiar with the coding. • VideoGames:-VPL helps to create the videogames without writing lines of codes Ex- Scratch VPL is used to make videogames. Dr. M. Sudharsan 15
  • 16.
    Scripting Language • Ascripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled. Dr. M. Sudharsan 16
  • 17.
    Hypertext markup Language •What Is HyperText Markup Language (HTML)? HyperText Markup Language (HTML) is the set of markup symbols or codes inserted into a file intended for display on the Internet. The markup tells web browsers how to display a web page's words and images. Dr. M. Sudharsan 17
  • 18.
    Extensible markup language •XML is a software- and hardware-independent tool for storing and transporting data. • XML stands for eXtensible Markup Language • XML is a markup language much like HTML • XML was designed to store and transport data <root> <child> <subchild>.....</subchild> </child> </root> Dr. M. Sudharsan 18
  • 19.
    Features of agood programming language A good programming language should possess several key features that make it effective, efficient, and user-friendly for developers. Readability: Code written in the language should be easy to read and understand. Clean and clear syntax promotes maintainability and collaboration among developers. Writability: A good language should allow developers to express their ideas concisely and efficiently, reducing the amount of code needed to perform tasks. Reliability: Programs written in the language should produce consistent and predictable results, with minimal unexpected behavior or errors. Portability: Code written in the language should be able to run on different platforms and systems without major modifications, promoting cross-platform compatibility. Scalability: The language should support the development of both small and large-scale applications, adapting to increasing complexities and requirements. Performance: It should allow developers to write efficient code, optimizing for speed and resource usage when necessary. Abstraction: The language should provide abstractions and data structures that simplify complex tasks, enabling developers to focus on solving problems rather than low-level details. Security: The language should include built-in security features and practices to help prevent common vulnerabilities like buffer overflows and injection attacks. Tooling: A good programming language should have a rich ecosystem of development tools, including integrated development environments (IDEs), debuggers, and testing frameworks. Memory Management: Efficient memory management mechanisms, such as automatic memory allocation and garbage collection, can reduce the risk of memory-related errors. Debugging and Testing: The language should offer robust debugging and testing capabilities to help developers identify and rectify issues during development. Error Handling: Effective error handling mechanisms should be in place to allow developers to gracefully handle exceptions and errors. Dr. M. Sudharsan 19
  • 20.
    UNIT 3 • Softwareis a set of instructions, data or programs used to operate computers and execute specific tasks. It is the opposite of hardware, which describes the physical aspects of a computer. • The two main categories of software are application software and system software. An application is software that fulfills a specific need or performs tasks Dr. M. Sudharsan 20