Chapter 05: INTRODUCTION TO COMPUTER PROGRAMMING
5.1 Basics of programming
• Algorithms and Flowcharts
• Basics
• Decision making
• Iterative
(With sufficient examples)
5.2 Programming Languages
• Generation of languages
• General concepts of variables and constants
1. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 73
Chapter 05: INTRODUCTION TO COMPUTER PROGRAMMING
Computer programming is the process of designing, writing, testing, and maintaining sets of instructions
(code) that a computer can execute. These instructions are written in programming languages, and they control
the behavior of a computer or a software application. Programming is a fundamental skill in the modern world,
and it plays a crucial role in various fields, from software development to data analysis, artificial intelligence,
and more. Here are some key concepts and topics to help you understand the basics of computer programming:
1. Programming Languages: Programming languages are used to communicate with computers. Examples
include Python, Java, C++, and JavaScript. Each language has its syntax and is suited for different types of
applications.
2. Algorithms: An algorithm is a step*by*step set of instructions for solving a specific problem. Algorithms
are fundamental to programming as they determine how a task is performed.
3. Data Structures: Data structures are ways to organize and store data efficiently. Common data structures
include arrays, lists, stacks, and queues.
4. Control Structures: Control structures, such as loops and conditionals (if*else statements), determine the
flow of a program. They help in making decisions and repeating actions.
5. Variables: Variables are used to store and manipulate data in a program. They can hold various types of
information, including numbers, text, and more.
6. Functions/Methods: Functions and methods are blocks of reusable code that perform specific tasks. They
help in organizing code and making it more modular.
7. Object*Oriented Programming (OOP): OOP is a programming paradigm that uses objects and classes
to model real*world entities and their interactions. It promotes code reusability and organization.
8. Integrated Development Environments (IDEs): IDEs are software applications that provide tools for
writing, testing, and debugging code. Popular IDEs include Visual Studio, PyCharm, and Eclipse.
9. Debugging: Debugging is the process of identifying and fixing errors or "bugs" in your code. It is a critical
skill for programmers.
2. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 74
10. Version Control: Version control systems like Git help programmers track changes to their code and
collaborate with others.
11. Software Development Life Cycle: Understanding the different stages of software development, such as
requirements gathering, design, coding, testing, and maintenance, is essential for creating high*quality
software.
12. Coding Best Practices: Learning and following coding best practices and style guidelines helps ensure
that your code is readable and maintainable.
13. Problem Solving: A significant part of programming involves breaking down complex problems into
smaller, more manageable parts and devising solutions for them.
14. Application Domains: Programming is used in various application domains, from web development and
mobile app development to game development, data science, and more.
15. Continuous Learning: The field of programming is constantly evolving. Staying up*to*date with the
latest technologies and programming trends is essential.
Learning computer programming is a valuable skill that opens up numerous career opportunities and allows
you to create software solutions for a wide range of problems. Whether you are interested in becoming a
professional software developer or simply want to automate tasks and solve problems with code,
understanding the fundamentals of programming is the first step on your journey.
5.1 Basics of programming
Certainly, let's delve into the basics of programming, which include algorithms, flowcharts, decision making,
and iterative constructs:
A) Algorithm: An algorithm is a step-by-step procedure or a set of well-defined instructions for solving a specific
problem or performing a task. It provides a clear, unambiguous solution to a problem. Algorithms are
fundamental to computer science and programming. They are step-by-step sets of instructions for solving a
specific problem or performing a specific task. Here are some key characteristics of algorithms:
3. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 75
1. Input: Every algorithm takes some input, which is the data the algorithm operates on. This input can be of
various types, such as numbers, text, or complex data structures.
2. Output: An algorithm produces an output, which is the result of its execution. The output can be a single
value, a set of values, or a modification to the input data.
3. Finiteness: An algorithm must terminate after a finite number of steps. It should not run indefinitely, also
known as halting. This characteristic is essential to ensure that the algorithm can be used in practice.
4. Certainty: Each step of an algorithm must be precisely and unambiguously defined. There should be no
room for interpretation or confusion about what each step entails.
5. Effectiveness: An algorithm should be effective, meaning that it can be executed by a human or a machine
and produce the correct result. It should be practical and feasible to execute within available resources.
6. Problem Solving: Algorithms are used to solve specific problems or tasks. They encapsulate a strategy or
method for tackling these problems, whether it's sorting a list of numbers, searching for an item in a database,
or performing complex computations.
7. Time Complexity: Algorithms can be analyzed in terms of their time complexity, which measures the
amount of time they take to run based on the size of the input data. Time complexity is often expressed using
big O notation (e.g., O(n) for linear time complexity).
8. Space Complexity: Algorithms can also be analyzed in terms of their space complexity, which measures
the amount of memory or storage they require based on the size of the input data. Space complexity is similarly
expressed using big O notation (e.g., O(1) for constant space complexity).
9. Correctness: A correct algorithm is one that solves the intended problem accurately and produces the
expected output for all valid inputs.
10. Adaptability: Some algorithms are adaptable to different situations, meaning they can be applied to
similar problems with slight modifications.
Algorithms are a fundamental concept in computer science, and their design and analysis are critical for
creating efficient and effective software solutions. Different algorithms may have varying characteristics
based on the specific problem they are designed to address and the trade-offs they make between factors like
time and space complexity.
B) Flowchart: A flowchart is a visual representation of a process, algorithm, or system, typically created to
illustrate the sequence of steps or activities involved in that process. Flowcharts use various symbols and
connectors to represent different elements and decisions within a process, making it easier for individuals to
understand, analyze, and communicate complex procedures or workflows. Here are some common symbols
and connectors used in flowcharts:
1. Start/End Symbol: Shaped like a capsule, oval, or rounded rectangle, it indicates the beginning or end of a
process or the start/end point of the flowchart.
4. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 76
2. Process Symbol: A rectangle with rounded corners represents a process, action, or operation that occurs in
the workflow. This can include calculations, data manipulation, or any other task.
3. Decision Symbol: A diamond-shaped symbol denotes a decision point where a question is asked, and the
flow can follow different paths depending on the answer (usually a yes/no question). Lines exiting from the
decision symbol indicate the possible paths or outcomes.
4. Input/Output Symbol: A parallelogram represents input or output operations, such as data entering the
process (input) or results being produced (output).
5. Connector Symbol: A circle with a letter or number inside (e.g., A, B, 1, 2) is used to label and reference
points in the flowchart. It helps to clarify complex flows by connecting lines to the same point labeled with
the corresponding connector symbol.
6. Flow Lines/Arrows: Arrows or lines connect the symbols to show the sequence or direction of the flow. A
solid line typically indicates the main flow, while dashed lines can be used for alternative paths or loops.
7. Terminator Symbol: A rounded rectangle with the word "STOP" or "END" is used to explicitly mark the
end of the flowchart. This is often optional but can provide clarity.
8. Predefined Process Symbol: A rectangle with double lines signifies a process that is predefined in another
part of the flowchart or in a separate document.
9. Document Symbol: A rectangle with a wavy base represents a document or report within the process.
10. Delay Symbol: A rectangle with a wavy bottom is used to indicate a time delay or waiting period within
the process.
11. Loop/Preparation Symbol: A rectangle with a vertical line on the right and two arrows pointing back
indicates a loop or iterative process.
12. Data Symbol: A parallelogram with vertical lines inside it denotes data storage or a data storage element
within the process.
5. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 77
13. On-Page Connector Symbol: A small circle, typically with a letter or number inside, is used to indicate a
connection to another part of the same page when the flowchart spans multiple pages.
Rules for Drawing a Flowchart
▪ It should contain only one start and one end symbol
▪ The relevant symbols must be used while drawing a flowchart
▪ The direction of arrows should be top to bottom and left to right
▪ It should be simple and drawn clearly and neatly
▪ Be consistent in using names, variables in the flow chart
▪ Use properly labeled connectors to link the portions of the flowchart on different pages
▪ The branches of decision box must be label
C) Basics:
• Variables: Variables are used to store data. They can hold various types of information, such as
numbers, text, or Boolean values.
• Data Types: Data types define the kind of data a variable can hold. Common data types include
integers, floating*point numbers, strings, and booleans.
• Operators: Operators are used to perform operations on data. Examples include arithmetic operators
o (+, *, *, /), comparison operators (>, <, ==), and logical operators (&&, ||).
• Input and Output: Programs often need to take input from users and produce output. Functions like
`input ()` and `print()` are used for this purpose.
6. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 78
D) Decision Making:
• If Statements: If statements are used for making decisions in a program. They allow you to execute
specific code blocks if certain conditions are met. For example:
• Switch Statements (or Case Statements): Some programming languages support switch statements,
which allow you to select one of several code blocks to execute based on the value of a variable or
expression.
E) Iterative Constructs:
• Loops: Loops are used to execute a block of code repeatedly. Common types of loops include:
• For Loop: Used to iterate over a sequence (e.g., a list) for a specific number of times.
• While Loop: Repeats a block of code as long as a given condition is true.
• Do-While Loop: Similar to a while loop but guaranteed to run at least once, as the condition is checked
after the loop body is executed.
• Break and Continue: The `break` statement is used to exit a loop prematurely, while the `continue`
statement skips the rest of the current iteration and moves to the next. Here's a simple example in
Python that combines these concepts:
5.2 Programming Languages
Programming languages are formal systems used to instruct computers to perform specific tasks. They serve
as a bridge between human-readable code and machine-executable instructions. Here's an overview of
programming languages, their generations, and some general concepts:
1. Generations of Programming Languages:
Programming languages have evolved through several generations, each with its characteristics and
capabilities:
a) First Generation (1GL): Machine language consists of binary code, which is the native language of
the computer's CPU. Programming in machine language is very low-level and challenging.
b) Second Generation (2GL): Assembly language uses mnemonics to represent machine instructions.
It's more human-readable than machine language but still closely tied to the computer's architecture.
c) Third Generation (3GL): High-level programming languages like FORTRAN, COBOL, and C were
developed to make programming more abstract and portable. They feature complex data types,
control structures, and user-defined functions.
7. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 79
d) Fourth Generation (4GL): These languages are designed for specific applications, such as SQL for
database querying and report generation. They offer a higher level of abstraction and often involve
less coding.
e) Fifth Generation (5GL): These languages focus on solving complex problems through natural
language and AI. They are still evolving and not as widely used as other generations.
2. General Concepts of Variables and Constants:
Variables: A variable in programming is a symbolic name given to a storage location in a program to store
data. It acts as a container that can hold different types of data, such as numbers, text, or more complex
structures. Variables are fundamental in programming, as they allow you to work with and manipulate data
in your code.
Here are the rules for naming a variable in most programming languages:
a) Variable Name Characters:
* Variable names can consist of letters (both uppercase and lowercase), digits, and underscores (_).
* They must start with a letter or an underscore.
* Most programming languages are case*sensitive, so "myVar" and "myvar" would be considered two
different variables.
b) Reserved Keywords: You cannot use reserved keywords (keywords that have special meanings in the
programming language) as variable names. For example, "if," "while," or "int" are often reserved words.
c) Length: Variable names should be meaningful but not excessively long. It's best to keep them concise and
descriptive of the data they represent.
d) Special Characters: Most programming languages do not allow special characters, such as spaces,
punctuation, or mathematical symbols, in variable names.
e) Numbers as the First Character: While most languages allow digits in variable names, they are typically
not allowed as the first character of the name. So, "7days" would be invalid, but "days7" would be acceptable.
Examples of valid variable names in a programming language (e.g., Python, JavaScript, C++):
1. `myVariable`
2. `counter`
3. `user_input`
4. `_privateVar`
5. `age_2`
6. `firstName`
It's important to choose meaningful and descriptive variable names to make your code more readable and
maintainable. This practice helps you and other developers understand the purpose of the variables and the
data they store.
8. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 80
Constants: Constants in programming are values that do not change during the execution of a program. They
are used to represent fixed or immutable data that should not be modified once defined. Constants provide a
way to make code more readable and maintainable by giving meaningful names to values that might otherwise
appear as "magic numbers" or unexplained literals. Here are some general rules for naming constants in most
programming languages:
1. Uppercase Convention:
* Constants are often named in all uppercase letters with words separated by underscores. This convention
makes them stand out from variables.
Example: `PI` for the mathematical constant π (3.14159265359).
2. Descriptive Names: Constants should have descriptive names that indicate their purpose or the value they
represent. Example: `MAX_LENGTH` for the maximum length of a string in a text*processing application.
3. Initialization: Constants must be initialized at the time of declaration and cannot be modified thereafter.
Example (in Python): `MAX_VALUE = 100` or (in C++): `const int MAX_VALUE = 100;`
4. Scope: Constants typically have a global scope, accessible from different parts of the program.
Example: In a C or C++ program, a constant defined at the beginning of the file can be used throughout the
file.
Examples of constants in various programming languages:
1. In Python:
```python
PI = 3.14159265359
MAX_SPEED = 100
DAYS_IN_A_WEEK = 7
```
2. In JavaScript:
```javascript
const GRAVITY = 9.81;
const API_KEY = "your_api_key_here";
const MAX_ATTEMPTS = 5;
```
3. In C++:
```cpp
const double EULER_NUMBER = 2.71828;
const int MAX_ALLOWED_CONNECTIONS = 100;
The use of constants helps improve code readability and maintainability because it makes the purpose of these
fixed values explicit. It also provides a central location to change these values, if necessary, without searching
for and modifying them throughout the code.
9. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 81
5.3 Process of Generating a Programming Language
The process of generating a programming language involves several stages, including design, specification,
implementation, and usage. Here's an overview of these stages with examples:
1. Design Stage:
• Purpose and Goals: The first step in creating a programming language is to define the purpose and
goals of the language. What problems will it solve? What kind of programs will it support?
Example: Python was designed to be a general*purpose, high*level language suitable for tasks ranging from
web development to scientific computing.
• Paradigm Selection: Choose the programming paradigm(s) the language will support. Common
paradigms include imperative, object*oriented, functional, and declarative.
Example: Haskell was designed with a focus on the functional programming paradigm, emphasizing
immutability and pure functions.
2. Specification Stage:
• Formal Syntax and Semantics: Create a formal specification for the language, including its syntax
and semantics. This defines how programs in the language will be structured and what they will do.
Example: The Backus*Naur Form (BNF) is a notation often used to specify the syntax of programming
languages.
• Standard Library: Design and document a standard library of functions and modules to provide
essential functionality to users.
Example: C++ includes the Standard Template Library (STL), which provides a rich set of data structures and
algorithms.
3. Implementation Stage:
• Compiler or Interpreter: Develop a compiler or interpreter for the language that translates
human*readable code into machine*executable code.
Example: The GCC (GNU Compiler Collection) is a widely*used compiler for the C and C++ programming
languages.
• Runtime Environment: Create the necessary runtime environment, including memory management,
garbage collection, and other system*level features.
Example: The Java Virtual Machine (JVM) is a runtime environment for the Java programming language.
10. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 82
4. Tools and Documentation:
• Development Tools: Provide development tools like integrated development environments (IDEs)
and debuggers to make it easier for programmers to write, test, and debug code.
Example: Visual Studio Code (VS Code) is a popular code editor that supports many programming languages
through extensions.
• Documentation: Produce extensive documentation, including language reference manuals, tutorials,
and examples.
Example: The Python documentation includes a comprehensive library reference and tutorials for beginners.
5. Community and Adoption:
Attract a community of users, developers, and contributors to support and expand the language's ecosystem.
Example: The PHP programming language has a strong online community and ecosystem of web
development frameworks like Laravel.
6. Feedback and Iteration:
Continuously gather feedback from users and developers to improve the language, fix bugs, and introduce
new features.
Example: The JavaScript language undergoes regular updates (ECMAScript) to address issues and introduce
new language features.
7. Standardization:
In some cases, programming languages are standardized to ensure compatibility and portability across
different implementations.
Example: C and C++ are standardized by the ISO (International Organization for Standardization).
8. Legacy and Evolution:
As a language matures, it may accumulate legacy code and practices, which can influence its evolution and
maintenance.
Example: COBOL, a language from the 1950s, still has a significant presence in legacy systems.
The process of generating a programming language is a complex and multifaceted undertaking, involving a
combination of design, engineering, community building, and maintenance. The success of a language
depends on its ability to meet the needs of its users and adapt to changing technology and programming trends.
11. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 83
Problems
(a) Write an algorithm to find area of circle. Using equation area (𝐴) = 𝜋 × 𝑟2
Algorithm Flowchart
Step 1: Start
Step 2: Input radius
Step 3: let pi = 3.14
or
type direct value 3.14 in equation eliminating this
step
Step 4: area = pi * radius * radius
Step 6: print area
Step 7: stop
(b) Write an algorithm for finding largest of 3 numbers.
Algorithm Flowchart
1. Start
2. Input A, B, C
3. If (A>B) and (A>C) then print “A is greater”.
Else if (B>A) and (B>C) then print “B is
greater”.
Else print “C is greater”.
4. Stop
12. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 84
(c) Write an algorithm to generate the following series
1,2, 4,7, 11, 16, 12, 29...
Hint:
The series 2, 4, 7, 11, 16, 22, 29…is achieved by following system.
1 + (1) = 2; 2 + (2) = 4; 4 + (3) = 7; 7 + (4) = 11; 11 + (5) = 16; 16 + (6) = 22; 22 + (7) = 29….
Algorithm Flowchart
Step-1: Start
Step-2: Input a number in variable n
Step-3: Let i=1
Step-4: If (i ≤ n), then go to step-5,
Otherwise go to step-7
Step-5: Print value of i
Step-6: i=i+i and again go to step-4
Step-7: Stop
Note: Step 6 is important; if i=i+1 we get
1 2 3 4 – – – – n Sequence.
if i=i+2 we get
1 3 5 7- – – n Sequence.
(a) Draw flowchart to accept the length of two different line segments and check whether they are equal
or unequal. Display the message accordingly.
Algorithm Flowchart
Step 1: Start
Step 2: Accept the length of the two lines
segments as l1 and l2.
Step 3: If l1 and l2 are equal, then display 'Line
Segments are equal'.
Step 4: If l1 and l2 are not equal, then display 'Line
Segments are not equal'.
Step 5: Stop
13. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 85
(b) Draw a flow chart to accept the age of a person and check whether he/she is a child, teenager or an
adult. A person is a child if the age is less than or equal to 14. A person is a teenager if the age is
between 15 and 17. A person is an adult if he age is greater than or equal to 18.
Algorithm Flowchart
Step 1: Start
Step 2: Accept the AGE in Decimal.
Step 3: If AGE <=14, then display “Child”
Else if AGE <=20, then display
“Teenager”
Else, display “Adult”
Step 4: Stop
(c) Raj has to reach his college at 9.00 am. If he leaves his house before 8.00 am, he will go by walk,
otherwise he takes a bus. Draw a flow chart for this given Scenario, to output how to travel.
Algorithm Flowchart
Step 1: Start
Step 2: Accept TIME of leaving the house in Hours
Step 3: If TIME <=8.00 am, then display
“Go by Walk”
Else, display “Go by Bus”
Step 4: Stop
14. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 86
Previous Year Question Papers
April / May 2021
SECTION*V
9. (a) Differentiate the following:
(i) Multitasking Operating System and Multiprocessing operating system.
(ii) Real time operating system and Batch processing operating system.
(b) Write an algorithm to find area of circle. Using equation area (𝐴) = 𝜋 × 𝑟2
(c) Draw flowchart to accept the length of wo different line segments and check whether they are equal
or unequal. Display the message accordingly.
10. (a) Explain generation of programming language. Give example for each.
(b) Define variable. Specify the rules for naming a variable. Give examples.
Octo / Nov 2021
SECTION*5
9. (a) Draw the block diagram of a computer and examine the working of functional units.
(b) Draw a flow chart to accept the age of a person and check whether he/she is a child, teenager or an
adult. A person is a child if the age is less than or equal to 14. A person is a teenager if the age is
between 15 and 17. A person is an adult if he age is greater than or equal to 18.
10. (a) Define flowchart. Explain different symbols used in flowchart
(b) Write an algorithm for finding largest of 3 numbers.
April / May 2022
SECTION*5
9. (a) Differentiate b/w Bios and UEFT.
(b) Explain high level language.
(c) Raj has to reach his college at 9.00 am. If he leaves his house before 8.00 am, he will go by walk,
otherwise he takes a bus. Draw a flow chart for this given Scenario, to output how to travel.
(d) Explain different types of constants.
10. (a) Discuss the characteristics algorithms.
(b) Write an algorithm to generate the following series 1,2, 4,7, 11, 16, 12, 29...
(c) Match the applications with following OS
Sl No Application Choice Operating System
1 Air bag in car A Mobile OS
2 Weather forecasting B Hard real time
3 Banking C Soft real time
4 Android D Network OS
5 Peer to peer E Distribution OS
15. Vidya Vikas Educational Trust (R),
Vidya Vikas Polytechnic
27-128, Mysore - Bannur Road Alanahally,Alanahally Post, Mysuru, Karnataka 570028
Prepared by: Mr Thanmay J.S, H.O.D Mechanical Engineering VVETP, Mysore Page | 87
Answer: Here's the match between the applications and the corresponding operating system categories:
1. Air bag in car - B (Hard real time)
2. Weather forecasting - C (Soft real time)
3. Banking - E (Distribution OS)
4. Android - A (Mobile OS)
5. Peer to peer - D (Network OS)
Here are explanations for each of the mentioned operating system categories. These categories of operating
systems serve different purposes and are tailored to specific application requirements.
1. Mobile OS (Mobile Operating System):
Mobile operating systems are designed specifically for mobile devices, such as smartphones and tablets. They
are optimized for touch screen interfaces, support various apps, and provide features like power management
and connectivity. Examples of mobile operating systems include Android, iOS, and Windows Mobile.
2. Hard Real-Time Operating System:
Hard real-time operating systems are designed for applications that require strict and deterministic timing and
response constraints. These systems guarantee that tasks will be executed within a specified timeframe. They
are commonly used in mission-critical applications like medical devices, aerospace, and automotive systems
where timing is critical to safety and functionality.
3. Soft Real-Time Operating System:
Soft real-time operating systems also prioritize timely task execution but provide more flexibility than hard
real-time systems. They can meet timing constraints most of the time but may not guarantee it in all situations.
Soft real-time systems are used in applications where timing is important but not as critical as in hard real-
time applications. Examples include multimedia systems and some industrial control systems.
4. Network OS (Network Operating System):
A network operating system is designed to manage and support networked resources and services. These
operating systems are often used in servers and network devices to facilitate communication, data sharing, and
resource management in a networked environment. Examples of network operating systems include Windows
Server, Linux with networking features, and Novell NetWare.
5. Distribution OS (Distributed Operating System):
A distributed operating system is designed to work across multiple interconnected computers or nodes in a
network. It provides a single unified interface to manage and access resources across the network as if they
were on a single computer. Distributed operating systems are used in distributed computing environments to
enhance resource sharing, fault tolerance, and scalability.
June / July 2023
SECTION*5
9. (a) Write an algorithm to find the area of a triangle.
(b) Define Flowchart. Write the notations/symbols used in flowchart.
10. (a) Define Variable. Specify the rule for naming a variable.
(b) Draw a flowchart to find whether a given number is even or odd