SlideShare a Scribd company logo
1 of 15
Download to read offline
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.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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
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
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

More Related Content

Similar to Fundamentals of Computer 20CS11T Chapter 5.pdf

Handwritten Text Recognition Using Machine Learning
Handwritten Text Recognition Using Machine LearningHandwritten Text Recognition Using Machine Learning
Handwritten Text Recognition Using Machine LearningIRJET Journal
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptxDivyaKS12
 
Computer education presentation - ARCH 383
Computer education presentation - ARCH 383Computer education presentation - ARCH 383
Computer education presentation - ARCH 383LipikaPandey
 
WELCOME TO AI PROJECT shidhant mittaal.pptx
WELCOME TO AI PROJECT shidhant mittaal.pptxWELCOME TO AI PROJECT shidhant mittaal.pptx
WELCOME TO AI PROJECT shidhant mittaal.pptx9D38SHIDHANTMITTAL
 
Mathematical models and algorithms challenges
Mathematical models and algorithms challengesMathematical models and algorithms challenges
Mathematical models and algorithms challengesijctcm
 
part 1 - intorduction data structure 2021 mte.ppt
part 1 -  intorduction data structure  2021 mte.pptpart 1 -  intorduction data structure  2021 mte.ppt
part 1 - intorduction data structure 2021 mte.pptabdoSelem1
 
Project for Student Result System
Project for Student Result SystemProject for Student Result System
Project for Student Result SystemKuMaR AnAnD
 
an analysis and new methodology for reverse engineering of uml behavioral
an analysis and new methodology for reverse engineering of uml behavioralan analysis and new methodology for reverse engineering of uml behavioral
an analysis and new methodology for reverse engineering of uml behavioralINFOGAIN PUBLICATION
 
GE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfGE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfAsst.prof M.Gokilavani
 
Performance Evaluation using Blackboard Technique in Software Architecture
Performance Evaluation using Blackboard Technique in Software ArchitecturePerformance Evaluation using Blackboard Technique in Software Architecture
Performance Evaluation using Blackboard Technique in Software ArchitectureEditor IJCATR
 
Over view of system analysis and design
Over view of system analysis and designOver view of system analysis and design
Over view of system analysis and designSaroj Dhakal
 

Similar to Fundamentals of Computer 20CS11T Chapter 5.pdf (20)

Jar chapter 1
Jar chapter 1Jar chapter 1
Jar chapter 1
 
SE.pdf
SE.pdfSE.pdf
SE.pdf
 
Software Engineer
Software EngineerSoftware Engineer
Software Engineer
 
Handwritten Text Recognition Using Machine Learning
Handwritten Text Recognition Using Machine LearningHandwritten Text Recognition Using Machine Learning
Handwritten Text Recognition Using Machine Learning
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptx
 
Computer education presentation - ARCH 383
Computer education presentation - ARCH 383Computer education presentation - ARCH 383
Computer education presentation - ARCH 383
 
WELCOME TO AI PROJECT shidhant mittaal.pptx
WELCOME TO AI PROJECT shidhant mittaal.pptxWELCOME TO AI PROJECT shidhant mittaal.pptx
WELCOME TO AI PROJECT shidhant mittaal.pptx
 
Mathematical models and algorithms challenges
Mathematical models and algorithms challengesMathematical models and algorithms challenges
Mathematical models and algorithms challenges
 
Waterfall model
Waterfall modelWaterfall model
Waterfall model
 
Class 7 lecture notes
Class 7 lecture notesClass 7 lecture notes
Class 7 lecture notes
 
DEVELOPMENT OF A MULTIAGENT BASED METHODOLOGY FOR COMPLEX SYSTEMS
DEVELOPMENT OF A MULTIAGENT BASED METHODOLOGY FOR COMPLEX SYSTEMSDEVELOPMENT OF A MULTIAGENT BASED METHODOLOGY FOR COMPLEX SYSTEMS
DEVELOPMENT OF A MULTIAGENT BASED METHODOLOGY FOR COMPLEX SYSTEMS
 
part 1 - intorduction data structure 2021 mte.ppt
part 1 -  intorduction data structure  2021 mte.pptpart 1 -  intorduction data structure  2021 mte.ppt
part 1 - intorduction data structure 2021 mte.ppt
 
Ijetcas14 468
Ijetcas14 468Ijetcas14 468
Ijetcas14 468
 
Project for Student Result System
Project for Student Result SystemProject for Student Result System
Project for Student Result System
 
an analysis and new methodology for reverse engineering of uml behavioral
an analysis and new methodology for reverse engineering of uml behavioralan analysis and new methodology for reverse engineering of uml behavioral
an analysis and new methodology for reverse engineering of uml behavioral
 
GE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfGE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdf
 
PRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdfPRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdf
 
Performance Evaluation using Blackboard Technique in Software Architecture
Performance Evaluation using Blackboard Technique in Software ArchitecturePerformance Evaluation using Blackboard Technique in Software Architecture
Performance Evaluation using Blackboard Technique in Software Architecture
 
UNIT-1.pptx
UNIT-1.pptxUNIT-1.pptx
UNIT-1.pptx
 
Over view of system analysis and design
Over view of system analysis and designOver view of system analysis and design
Over view of system analysis and design
 

More from THANMAY JS

Multimedia and Animation 20CS21P Portfolio.pdf
Multimedia and Animation 20CS21P Portfolio.pdfMultimedia and Animation 20CS21P Portfolio.pdf
Multimedia and Animation 20CS21P Portfolio.pdfTHANMAY JS
 
Fundamentals of Automation Technology 20EE43P Portfolio.pdf
Fundamentals of Automation Technology 20EE43P Portfolio.pdfFundamentals of Automation Technology 20EE43P Portfolio.pdf
Fundamentals of Automation Technology 20EE43P Portfolio.pdfTHANMAY JS
 
Elements of Industrial Automation Portfolio.pdf
Elements of Industrial Automation Portfolio.pdfElements of Industrial Automation Portfolio.pdf
Elements of Industrial Automation Portfolio.pdfTHANMAY JS
 
Fundamentals of Computer 20CS11T Chapter 4.pdf
Fundamentals of Computer 20CS11T Chapter 4.pdfFundamentals of Computer 20CS11T Chapter 4.pdf
Fundamentals of Computer 20CS11T Chapter 4.pdfTHANMAY JS
 
Fundamentals of Computer 20CS11T Chapter 3.pdf
Fundamentals of Computer 20CS11T Chapter 3.pdfFundamentals of Computer 20CS11T Chapter 3.pdf
Fundamentals of Computer 20CS11T Chapter 3.pdfTHANMAY JS
 
Fundamentals of Computer 20CS11T Chapter 2.pdf
Fundamentals of Computer 20CS11T Chapter 2.pdfFundamentals of Computer 20CS11T Chapter 2.pdf
Fundamentals of Computer 20CS11T Chapter 2.pdfTHANMAY JS
 
Fundamentals of Computer 20CS11T.pdf
Fundamentals of Computer 20CS11T.pdfFundamentals of Computer 20CS11T.pdf
Fundamentals of Computer 20CS11T.pdfTHANMAY JS
 
Elements of Industrial Automation Week 09 Notes.pdf
Elements of Industrial Automation Week 09 Notes.pdfElements of Industrial Automation Week 09 Notes.pdf
Elements of Industrial Automation Week 09 Notes.pdfTHANMAY JS
 
Elements of Industrial Automation Week 08 Notes.pdf
Elements of Industrial Automation Week 08 Notes.pdfElements of Industrial Automation Week 08 Notes.pdf
Elements of Industrial Automation Week 08 Notes.pdfTHANMAY JS
 
Elements of Industrial Automation Week 07 Notes.pdf
Elements of Industrial Automation Week 07 Notes.pdfElements of Industrial Automation Week 07 Notes.pdf
Elements of Industrial Automation Week 07 Notes.pdfTHANMAY JS
 
Elements of Industrial Automation Week 06 Notes.pdf
Elements of Industrial Automation Week 06 Notes.pdfElements of Industrial Automation Week 06 Notes.pdf
Elements of Industrial Automation Week 06 Notes.pdfTHANMAY JS
 
Elements of Industrial Automation Week 04 Notes.pdf
Elements of Industrial Automation Week 04 Notes.pdfElements of Industrial Automation Week 04 Notes.pdf
Elements of Industrial Automation Week 04 Notes.pdfTHANMAY JS
 
Elements of Industrial Automation Week 03 Notes.pdf
Elements of Industrial Automation Week 03 Notes.pdfElements of Industrial Automation Week 03 Notes.pdf
Elements of Industrial Automation Week 03 Notes.pdfTHANMAY JS
 
Elements of Industrial Automation Week 02 Notes.pdf
Elements of Industrial Automation Week 02 Notes.pdfElements of Industrial Automation Week 02 Notes.pdf
Elements of Industrial Automation Week 02 Notes.pdfTHANMAY JS
 
Elements of Industrial Automation Week 01 Notes.pdf
Elements of Industrial Automation Week 01 Notes.pdfElements of Industrial Automation Week 01 Notes.pdf
Elements of Industrial Automation Week 01 Notes.pdfTHANMAY JS
 
Automation and Robotics Week 08 Theory Notes 20ME51I.pdf
Automation and Robotics Week 08 Theory Notes 20ME51I.pdfAutomation and Robotics Week 08 Theory Notes 20ME51I.pdf
Automation and Robotics Week 08 Theory Notes 20ME51I.pdfTHANMAY JS
 
Automation and Robotics Week 07 Theory Notes 20ME51I.pdf
Automation and Robotics Week 07 Theory Notes 20ME51I.pdfAutomation and Robotics Week 07 Theory Notes 20ME51I.pdf
Automation and Robotics Week 07 Theory Notes 20ME51I.pdfTHANMAY JS
 
Automation and Robotics Week 06 Theory Notes 20ME51I.pdf
Automation and Robotics Week 06 Theory Notes 20ME51I.pdfAutomation and Robotics Week 06 Theory Notes 20ME51I.pdf
Automation and Robotics Week 06 Theory Notes 20ME51I.pdfTHANMAY JS
 
Automation and Robotics Week 05 Theory Notes 20ME51I.pdf
Automation and Robotics Week 05 Theory Notes 20ME51I.pdfAutomation and Robotics Week 05 Theory Notes 20ME51I.pdf
Automation and Robotics Week 05 Theory Notes 20ME51I.pdfTHANMAY JS
 
Automation and Robotics Week 04 Theory Notes 20ME51I.pdf
Automation and Robotics Week 04 Theory Notes 20ME51I.pdfAutomation and Robotics Week 04 Theory Notes 20ME51I.pdf
Automation and Robotics Week 04 Theory Notes 20ME51I.pdfTHANMAY JS
 

More from THANMAY JS (20)

Multimedia and Animation 20CS21P Portfolio.pdf
Multimedia and Animation 20CS21P Portfolio.pdfMultimedia and Animation 20CS21P Portfolio.pdf
Multimedia and Animation 20CS21P Portfolio.pdf
 
Fundamentals of Automation Technology 20EE43P Portfolio.pdf
Fundamentals of Automation Technology 20EE43P Portfolio.pdfFundamentals of Automation Technology 20EE43P Portfolio.pdf
Fundamentals of Automation Technology 20EE43P Portfolio.pdf
 
Elements of Industrial Automation Portfolio.pdf
Elements of Industrial Automation Portfolio.pdfElements of Industrial Automation Portfolio.pdf
Elements of Industrial Automation Portfolio.pdf
 
Fundamentals of Computer 20CS11T Chapter 4.pdf
Fundamentals of Computer 20CS11T Chapter 4.pdfFundamentals of Computer 20CS11T Chapter 4.pdf
Fundamentals of Computer 20CS11T Chapter 4.pdf
 
Fundamentals of Computer 20CS11T Chapter 3.pdf
Fundamentals of Computer 20CS11T Chapter 3.pdfFundamentals of Computer 20CS11T Chapter 3.pdf
Fundamentals of Computer 20CS11T Chapter 3.pdf
 
Fundamentals of Computer 20CS11T Chapter 2.pdf
Fundamentals of Computer 20CS11T Chapter 2.pdfFundamentals of Computer 20CS11T Chapter 2.pdf
Fundamentals of Computer 20CS11T Chapter 2.pdf
 
Fundamentals of Computer 20CS11T.pdf
Fundamentals of Computer 20CS11T.pdfFundamentals of Computer 20CS11T.pdf
Fundamentals of Computer 20CS11T.pdf
 
Elements of Industrial Automation Week 09 Notes.pdf
Elements of Industrial Automation Week 09 Notes.pdfElements of Industrial Automation Week 09 Notes.pdf
Elements of Industrial Automation Week 09 Notes.pdf
 
Elements of Industrial Automation Week 08 Notes.pdf
Elements of Industrial Automation Week 08 Notes.pdfElements of Industrial Automation Week 08 Notes.pdf
Elements of Industrial Automation Week 08 Notes.pdf
 
Elements of Industrial Automation Week 07 Notes.pdf
Elements of Industrial Automation Week 07 Notes.pdfElements of Industrial Automation Week 07 Notes.pdf
Elements of Industrial Automation Week 07 Notes.pdf
 
Elements of Industrial Automation Week 06 Notes.pdf
Elements of Industrial Automation Week 06 Notes.pdfElements of Industrial Automation Week 06 Notes.pdf
Elements of Industrial Automation Week 06 Notes.pdf
 
Elements of Industrial Automation Week 04 Notes.pdf
Elements of Industrial Automation Week 04 Notes.pdfElements of Industrial Automation Week 04 Notes.pdf
Elements of Industrial Automation Week 04 Notes.pdf
 
Elements of Industrial Automation Week 03 Notes.pdf
Elements of Industrial Automation Week 03 Notes.pdfElements of Industrial Automation Week 03 Notes.pdf
Elements of Industrial Automation Week 03 Notes.pdf
 
Elements of Industrial Automation Week 02 Notes.pdf
Elements of Industrial Automation Week 02 Notes.pdfElements of Industrial Automation Week 02 Notes.pdf
Elements of Industrial Automation Week 02 Notes.pdf
 
Elements of Industrial Automation Week 01 Notes.pdf
Elements of Industrial Automation Week 01 Notes.pdfElements of Industrial Automation Week 01 Notes.pdf
Elements of Industrial Automation Week 01 Notes.pdf
 
Automation and Robotics Week 08 Theory Notes 20ME51I.pdf
Automation and Robotics Week 08 Theory Notes 20ME51I.pdfAutomation and Robotics Week 08 Theory Notes 20ME51I.pdf
Automation and Robotics Week 08 Theory Notes 20ME51I.pdf
 
Automation and Robotics Week 07 Theory Notes 20ME51I.pdf
Automation and Robotics Week 07 Theory Notes 20ME51I.pdfAutomation and Robotics Week 07 Theory Notes 20ME51I.pdf
Automation and Robotics Week 07 Theory Notes 20ME51I.pdf
 
Automation and Robotics Week 06 Theory Notes 20ME51I.pdf
Automation and Robotics Week 06 Theory Notes 20ME51I.pdfAutomation and Robotics Week 06 Theory Notes 20ME51I.pdf
Automation and Robotics Week 06 Theory Notes 20ME51I.pdf
 
Automation and Robotics Week 05 Theory Notes 20ME51I.pdf
Automation and Robotics Week 05 Theory Notes 20ME51I.pdfAutomation and Robotics Week 05 Theory Notes 20ME51I.pdf
Automation and Robotics Week 05 Theory Notes 20ME51I.pdf
 
Automation and Robotics Week 04 Theory Notes 20ME51I.pdf
Automation and Robotics Week 04 Theory Notes 20ME51I.pdfAutomation and Robotics Week 04 Theory Notes 20ME51I.pdf
Automation and Robotics Week 04 Theory Notes 20ME51I.pdf
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 

Recently uploaded (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 

Fundamentals of Computer 20CS11T Chapter 5.pdf

  • 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