Top Banner
Prof. B. I. Khodanpur Prof. B. I. Khodanpur HOD – Dept. of CSE HOD – Dept. of CSE R. V. College of Engineering. R. V. College of Engineering. EmailID: EmailID: [email protected] [email protected] Subject: Computer Fundamentals (For EDUSAT) Common Paper for BA / B.Com / B.Sc Code: CS-54
27

Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: [email protected] Subject: Computer Fundamentals (For EDUSAT) Common.

Dec 16, 2015

Download

Documents

Junior Nelson
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Prof. B. I. KhodanpurProf. B. I. KhodanpurHOD – Dept. of CSEHOD – Dept. of CSE

R. V. College of Engineering.R. V. College of Engineering.EmailID:EmailID:   [email protected]@gmail.com

Subject: Computer Fundamentals (For EDUSAT)

Common Paper for BA / B.Com / B.Sc

Code: CS-54

Page 2: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Types of OS:

Operating System can also be classified as,-

Single User Systems

Multi User Systems

Page 3: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Single User Systems:

Provides a platform for only one user at a time.

They are popularly associated with Desk Top operating system which run on standalone systems where no user accounts are required.

Example: DOS

Page 4: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Multi-User Systems:

Provides regulated access for a number of users by maintaining a database of known users.

Refers to computer systems that support two or more simultaneous users.

Another term for multi-user is time sharing.

Ex: All mainframes and  are multi-user systems. Example: Unix

Page 5: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Contents Today's Topic: Problem Solving Techniques

We will learnWe will learn1.1. Problem Statement.Problem Statement.

2.2. AlgorithmAlgorithm Types, ExampleTypes, Example

3.3. FlowchartFlowchart Symbols, Examples.Symbols, Examples.

Page 6: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Problem Solving Problem Solving TechniquesTechniques

Page 7: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Problem Statement:

Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this stage include Algorithms and flowcharts for identifying the expected steps of a process. Therefore to solve any problem,

Collect and analyze information and data Talk with people familiar with the problem If at all possible, view the problem first hand Confirm all findings

Page 8: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Algorithm: The algorithm is part of the blueprint or plan for the

computer program, an algorithm is:

“An effective procedure for solving a class of problems in a finite number of steps.”

Every algorithm should have the following 5 characteristic feature:

1. Input2. Output3. Definiteness4. Effectiveness5. Termination

Page 9: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Algorithm (Contd…): To find largest of three numbers1) Start2) Read 3 numbers: num1, num2, num33) if num1 > num2 then go to step 54) if num2 > num3 then

print num2 is largest else

print num3 is largest goto step 65) if num1 > num3 then

print num1 is largest else

print num3 is largest6) end.

Page 10: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Algorithm (Contd…):

Example: One of the simplest algorithms is to find the

largest number in an (unsorted) list of numbers.

High-level description:

1) Assume the first item is largest. 2) Look at each of the remaining items in the list and if

it is larger than the largest item so far, make a note of it.

3) The last noted item is the largest in the list when the process is complete.

Page 11: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Algorithm (Contd…): Formal description: Written in prose but much closer to

the high-level language of a computer program, the following is the more formal coding of the algorithm in pseudo code (find the largest number in an (unsorted) list of numbers)

Algorithm LargestNumber Input: A non-empty list of numbers L. Output: The largest number in the list L.

1) largest ← L0 for each item in the list L, do 2) if the item > largest, then 3) largest ← the item 4) return largest

Page 12: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flowchart:

What is a Flowchart? The flowchart is a means of visually presenting the flow

of control through an information processing systems, the operations performed within the system and the sequence in which they are performed.

It is a graphic representation of how a process works, showing, at a minimum, the sequence of steps.

Flowcharts are generally drawn in the early stages of formulating computer solutions.

Page 13: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flowchart (Contd…):

Guideline for drawing a flowchart: Flowcharts are usually drawn using some standard

symbols; Some standard symbols, which are frequently required for flowcharting many computer programs are shown below,-

Page 14: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flowchart (Contd…):

A set of useful standard Flowchart symbols: Rounded box use it to represent an event which occurs automatically. Rectangle or box use it to represent an event which is controlled within

the process. Typically this will be a step or action which is taken.

Diamond use it to represent a decision point in the process. Circle use it to represent a point at which the flowchart

connects with another process.

Page 15: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

ADVANTAGES OF USING FLOWCHARTS: Communication: Flowcharts are better way of

communicating the logic of a system Effective analysis: Problem can be analyzed in more

effective way. Proper documentation: Flowcharts serve as a good

program documentation Efficient Coding: Flowcharts act as a guide or blueprint

during the systems analysis and program development phase.

Page 16: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

ADVANTAGES OF USING FLOWCHARTS (Contd…): Proper Debugging: Flowchart helps in debugging

process.

Efficient Program Maintenance: The maintenance of operating program becomes easy with the help of flowchart.

Page 17: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flow chart of the while loop :

Page 18: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flow chart of the for loop:

Page 19: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

The flow chart of the if statement:

Page 20: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

The flow chart of the if…else statement:

Page 21: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

The flow chart of the switch statement:

Page 22: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flowchart for finding the sum of first five natural numbers ( i.e. 1,2,3,4,5):

Page 23: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flowchart (Example):Flowchart to find the sum of first 50 natural numbers.

Page 24: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Start

Read A, B

Is A > B

Print A Print B

End

Yes No

Flow Chart to find largest of two numbers:

Page 25: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flowchart to find the largest of three numbers A,B, and C:

NO

Page 26: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

LIMITATIONS OF USING FLOWCHARTS: Complex logic: Sometimes, the program logic is quite

complicated. In that case, flowchart becomes complex and clumsy.

Alterations and Modifications: If alterations are required the flowchart may require re-drawing completely.

Reproduction: As the flowchart symbols cannot be typed, reproduction of flowchart becomes a problem.

Page 27: Prof. B. I. Khodanpur HOD – Dept. of CSE R. V. College of Engineering. EmailID: bi.khodanpur@gmail.com Subject: Computer Fundamentals (For EDUSAT) Common.

Flowchart (Exercise):

1. Draw a flowchart to depict all steps that you do reach your college.

2. Draw Flowchart for Linear search.