Lecture No 7 Problem Solving concepts Overview Learning

Lecture No. 7 Problem Solving concepts

Overview • • • Learning Objectives Learning Outcomes Algorithm, Flowchart and Pseudo. Code Communicating with the Computer Software Development Life Cycle Organizing the Solution Using the Tools Testing the Solution Coding the Solution Development Cycle Summary

Learning Objectives • To organize the solution • To test the solution • To understand software development life cycle

Learning Outcomes • • The Students are able to: Organize the solution Test the solution Understand software development life cycle

Coupling Diagram CONTROL Var 1 Var 2 Var n MODULE N

Coupling Diagram for Payroll System

Algorithm for Payroll System Control Module: 1. Start 2. Process Read(*mass, *velocity) 3. Process Calc(mass, velocity, *Kinetic. Energy) 4. Process Print(Kinetic. Energy) 5. Stop

Algorithm for Payroll System Read(*Hours, *Pay. Rate): 1. Read Hours, Pay. Rate 2. Exit Calc (Hours, Pay. Rate, *Gross. Pay) : 1. Gross. Pay= Hours* Pay. Rate 2. Exit Display (Gross. Pay): 1. Print Gross Pay 2. Exit

Flowchart for Payroll System

The Payroll Problem 0 -10

Read Module

Calc Module

Print Module

Order of Execution of Instructions

Rules for Flowchart 1. You should write the instructions inside the blocks. 2. Draw an annotated flowchart means as per requirement add variables, note. 3. A flowchart always starts at the top of the page and flows to the bottom. Use Page connector if flowchart is large. 4. Use a computer program, or a template and a straightedge, to draw the flowchart. 5. Make the blocks big enough to write instructions so they can be easily read. 6. Put the module number and name from the interactivity chart in the upperright-hand corner of the page for quick reference to the correct module. 7. Have plenty of paper on hand since the final copy of the flowchart normally will not be the first draft. 8. Use a pencil with a large eraser.

Pseudo Code for Pay Roll System 1. Start 2. Read Hours & Pay. Rate 3. Calculate Gross. Salary 4. Print Gross. Salary 5. Stop

Internal & External Documentation • Internal documentation consists of remarks written with the instructions to explain what is being done in the program. • External documentation is made up of the manuals or help menus written about the solution

Testing a solution • it is important to test the solution • To test a solution, the programmer selects test data, a set of values for the input data, and works them through every step in the solution. • It is important to select test data carefully, so the correctness of the results can be checked

Coding a solution • The step of writing the solution of the problem into a computer language—that is, coding

Good Quote Computers are only as good as their hardware, their software, and the people using them!

How the computer stores data? The data is stored externally on an external devices i. e. hard disk drive in storage area is called files. 1. Program Files- it contains instructions to tell the computer what to do 2. Data Files- contains the data required to execute the program files. A buffer is used to copy files from external memory source to the internal memory and vice versa.

Communicating the computer • Syntax refers to the rules governing the computer operating system the language and application • Bugs: Syntactical and Logical • Debugging

Flowchart Symbols 0 -23

Flowchart Symbols 0 -24

Flowchart Symbols 0 -25

Flowchart Symbols 0 -26

Summary • Various symbols of flowchart

a. X Home Assignment I. List out all symbols of flowchart

a. X Important Questions I. Explain symbols of flowchart

a. X Great Thought
- Slides: 30