Pseudocode & Flowcharts

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

Exercise (1).
PROBLEM SOLVING TECHNIQUES
Flow Control Analysis & Design Tool: Flowcharts
ALGORITHMS AND FLOWCHARTS
Chapter 1 Pseudocode & Flowcharts
INTRODUCTION TO PROGRAMMING
Chapter 2- Visual Basic Schneider
Developing logic (Examples on algorithm and flowchart)
Chapter 3 Planning Your Solution
Review Algorithm Analysis Problem Solving Space Complexity
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
CSC141 Introduction to Computer Programming
Programming Concepts Chapter 3.
CSCI 3133 Programming with C Instructor: Bindra Shrestha University of Houston – Clear Lake.
Software Life Cycle What Requirements Gathering, Problem definition
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
Chapter 2: General Problem Solving Concepts
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 1 st semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Basic problem solving CSC 111.
Chapter 1 Pseudocode & Flowcharts
1 Program Planning and Design Important stages before actual program is written.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
1 Algorithms Practice Topics In-Class Project: Tip Calculator In-Class Project: Drawing a Rectangle.
Concepts of Algorithms CSC-244 Unit Zero Pseudo code, Flowchart and Algorithm Master Prince Computer College Qassim University K.S.A.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
ALGORITHMS AND FLOWCHARTS. A typical programming task can be divided into two phases: Problem solving phase  produce an ordered sequence of steps that.
Introduction to Flowcharts
Lecture 2: Introduction to Programming EEE2108: 공학프로그래밍 서강대학교 전자공학과 2011 학년도 2 학기 - Algorithms and Flowcharts -
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Problem Solving Flowcharts. Flowcharts Introduction  Flowcharts allow us to create a visual representation of a solution to a problem DRAW  With flowcharts,
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Chapter 1 Introduction 2nd Semester H
Chapter One Problem Solving
Program design Program Design Process has 2 phases:
GC101 Introduction to computers and programs
Unit 3: ALGORITHMS AND FLOWCHARTS
Chapter One Problem Solving
Chapter 2- Visual Basic Schneider
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Computer Programming Flowchart.
Algorithms and Flowcharts
Introduction To Flowcharting
2.0 Problem Solving PROGRAM DESIGN
ALGORITHMS AND FLOWCHARTS
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
PROBLEM SOLVING CSC 111.
Structured Program Design
1) C program development 2) Selection structure
ALGORITHMS AND FLOWCHARTS
Chapter 2- Visual Basic Schneider
Algorithms & Pseudocode & Flowcharts
Chapter 1 Pseudocode & Flowcharts
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Dr. Nouf Aljaffan Exercise solutions Dr. Nouf Aljaffan
Introduction to Programming
Chapter 1 Pseudocode & Flowcharts
Algorithms & Pseudocode & Flowcharts
Presentation transcript:

Pseudocode & Flowcharts CSC 1101 2/7/18 Pseudocode & Flowcharts CSC 1101- C++ Programming Language (1) Dr. Nouf Aljaffan naljaffan@ksu.edu.sa (C) 2017 Nouf Aljaffan

Stages in Program Development Process CSC 1101 2/7/18 1- Analysis of a problem 2- Create the algorithm 3- Compile the program 4- Execute the program 5- Testing and Debugging the Program Stages in Program Development Process (C) 2017 Nouf Aljaffan

(2) Create the algorithm Plan for solution and use basic statements and expression to develop the algorithm

B-Planning the Solution CSC 1101 2/7/18 Pseudocode is a semi-programming language used to describe the steps in an algorithm. Flowchart is a graphical representation of an algorithm. B-Planning the Solution (C) 2017 Nouf Aljaffan

Pseudocode Example Write a Program to Print the Sum of two integer Numbers Start Read Num1, Num2 Sum = Num1 + Num2 Write Sum End Asma Alosaimi

Flowcharts Symbols PROCESS INPUT/OUTPUT DECISION START/END FLOWLINE CSC 1101 2/7/18 PROCESS INPUT/OUTPUT DECISION START/END FLOWLINE Flowcharts Symbols (C) 2017 Nouf Aljaffan

Solution start Draw a flowchart for a program that calculates and print the area and the perimeter of a rectangle. Input Length width Processing Area = length*width Perimeter = 2*( length + width) Output Area Perimeter Read L, W area = L * W perimeter = 2 (L+W) Print area Print perimeter End Asma Alosaimi

Total_Sal = Salary +Overtime Example 2 Draw the flow chart for a program that calculates the total salary for an employee using this equation: Total_Sal = Salary +Overtime Asma Alosaimi

Solution start Input Salary Overtime Processing Read Salary Total_Sal = Salary +Overtime Output Total_Sal Read Salary Read Overtime Total_Sal = Salary +Overtime Print Total_Sal End Asma Alosaimi

Example 3 Draw a flowchart for a program that determine if the temperature degree is above or below freezing. Input Temp. Processing Check if Temp is below the 32  below freezing. Check if Temp is above the 32  above freezing. Output Print “below freezing” or “above freezing” Asma Alosaimi

Solution Asma Alosaimi

Example 4 Draw a flowchart for a program that calculates the Zakat, where the user enter the amount of money then the program show the zakat. Zakat =(2.5/100) * amount. Zakat is not calculated if the amount is less than 1000 S.R Asma Alosaimi

Solution Input amount. Processing Check if amount is below 1000  Zakat =0. Check if amount is above 1000 Zakat =(2.5/100) * amount Output Zakat Asma Alosaimi

Solution no Start Read amount yes Amount > 1000 Zakat =0. Zakat =(2.5/100)*amount Print Zakat Asma Alosaimi End