LU3 FLOWCHART - Problem Solving in Computing PDF
Document Details
Uploaded by DeftAntigorite3526
Universiti Malaysia Sarawak (UNIMAS)
Michelle Anak George, Eaqerzilla Phang, Dr Sinarwati Binti Mohamad Suhaili
Tags
Summary
This document presents an overview of flowcharts, algorithm, and pseudocode within the context of problem-solving in computing. The document provides examples and explanations. Numerous diagrams and examples are used throughout this learning material.
Full Transcript
PRL1013 PROBLEM SOLVING IN COMPUTING LU3: Designing the Solution Michelle Anak George Eaqerzilla Phang Dr Sinarwati Binti Mohamad Suhaili I: EP D:M G Agenda SUB-TOPICS COVER IN LEARNING UNIT -Flowchart -Ps...
PRL1013 PROBLEM SOLVING IN COMPUTING LU3: Designing the Solution Michelle Anak George Eaqerzilla Phang Dr Sinarwati Binti Mohamad Suhaili I: EP D:M G Agenda SUB-TOPICS COVER IN LEARNING UNIT -Flowchart -Pseudocode -Algorithm I: EP D:M G Wh a t i s a fl ow ch a rt (Dictionary) A schematic representation of a sequence of operations, as in a manufacturing process or computer program. (Technical) A graphical representation of the sequence of operations in an information system or program. Information system flowcharts show how data flows from source documents through the computer to final distribution to users. Program flowcharts show the sequence of instructions in a single program or subroutine. I: EP D:M Different symbols are used to draw each type of G T H E F LOW CH ART A Flowchart shows logic of an algorithm emphasizes individual steps and their interconnections e.g. control flow from one action to the next I: EP D:M G FLOWCH ART S Y M BOLS - BAS IC Name Symbol Use in Flowchart Oval Denotes the beginning or end of the program Parallelogram Denotes an input operation Rectangle Denotes a process to be carried out e.g. addition, subtraction, division etc. Diamond Denotes a decision (or branch) to be made. The program should continue along one of two routes. (e.g. IF/THEN/ELSE) Hybrid Denotes an output operation I: EP D:M G Flow line Denotes the direction of logic flow in the program EXAM PLE S CEN AR I O Example 1: Write an algorithm to determine a student’s final grade and indicate whether it is passing or failing. The final grade is calculated as the average of four marks. I: EP D:M G EXAM PLE S OLU T I ON Step 1: Input M1,M2,M3,M4 Step 2: GRADE (M1+M2+M3+M4)/4 Step 3: if (GRADE < 50) then Print “FAIL” else Print “PASS” endif I: EP D:M G EXAM PLE S OLU T I ON S START Input Step 1: Input M1,M2,M3,M4 M1,M2,M3,M4 Step 2: GRADE (M1+M2+M3+M4)/4 Step 3: if (GRADE