Al-Karma Language School Computer Department Prep. 3.

Slides:



Advertisements
Similar presentations
Representing an algorithm using Flowcharts
Advertisements

Exercise (1).
MATLAB Examples. CS 1112 MATLAB Examples Find the number of positive numbers in a vector x = input( 'Enter a vector: ' ); count = 0; for ii = 1:length(x),
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
Using Flowcharts. Sample Flowchart (without text) 2.
Subject: Information Technology Grade: 10
Fundamentals of Algorithms MCS - 2 Lecture # 4
÷ 2 0 = 1 0.
ITEC113 Algorithms and Programming Techniques
1 Session-7 CSIT 121 Spring 2006 Lab Demo of NiMo Lesson 3-2 Exercises 1,2,3,4,5,6 (Arithmetic Operators with Program ‘Convert.cpp’) Q&A about operators.
LOOP (Part 2) for while do-while 1. TK1913-C Programming2 TK1913-C Programming 2 Loop : for Loop : for Condition is tested first Loop is controlled by.
1 Lab Session-3 CSIT 121 Spring’05 Division rules Operator precedence rules Lab Exercise.
6.3 Dividing Polynomials. Warm Up Without a calculator, divide the following Solution:
Algorithm & Flowchart.
division algorithm Before we study divisibility, we must remember the division algorithm. r dividend = (divisor ⋅ quotient) + remainder.
Chapter 1 Pseudocode & Flowcharts
ALGORITHMS AND FLOWCHARTS
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Looping While-continue.
General, Organic, and Biological Chemistry Fourth Edition Karen Timberlake 1.6 Significant Figures in Calculations Chapter 1 Chemistry and Measurements.
Chapter 2 - Algorithms and Design
Dividing Polynomials Intro - Chapter 4.1. Using Long Division Example 1: Dividing Polynomials DIVISOR DIVIDEND REMAINDER QUOTIENT.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
CSEB114: Principle of programming
Flowcharts! January 13, 2005 These are today’s notes! Do you think we will get more snow?
End Show Writing a computer program involves performing the following tasks. 1. Understanding the problem 2. Developing an Algorithm for the problem 3.
Long Division Algorithm and Synthetic Division!!!
PSEUDOCODE C Programming Technique – Firdaus-Harun.com.
PROBLEM SOLVING & ALGORITHMS CHAPTER 5: CONTROL STRUCTURES - SELECTION.
Chapter 2 - Algorithms and Design print Statement input Statement and Variables Assignment Statement if Statement Flowcharts Flow of Control Looping with.
Control Structures II Repetition (Loops). Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
1 Chapter 2 - Algorithms and Design print Statement input Statement and Variables Assignment Statement if Statement Flowcharts Flow of Control Looping.
ITEC113 Algorithms and Programming Techniques
CHAPTER#3 PART1 STRUCTURED PROGRAM DEVELOPMENT IN C++ 2 nd semester King Saud University College of Applied studies and Community Service Csc.
EXERCISES for ALGORITHMS WRITING
Basic problem solving CSC 111.
Python Selection. All the programs you have been developing so far have been sequential, this means that each instruction is executed in a set order.
Dividing Polynomials.
Chapter#3 Part1 Structured Program Development in C++
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Sequencing The most simple type of program uses sequencing, a set of instructions carried out one after another. Start End Display “Computer” Display “Science”
Enhancing Websites with JavaScript. How Do You Give Directions? Lots of details? Specific steps? Just the gist? What language?
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
1 Class Chapter Objectives Use a while loop to repeat a series of statements Get data from user through an input dialog box Add error checking.
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
Topics: Selection Statements. Processing Involving Selecting Instructions An instruction that allows deviation and selection to take place uses the ‘IF’
 2003 Prentice Hall, Inc. All rights reserved. 1 Will not cover 4.14, Thinking About Objects: Identifying Class Attributes Chapter 4 - Control Structures.
WHAT IS THIS? Clue…it’s a drink SIMPLE SEQUENCE CONTROL STRUCTURE Introduction A computer is an extremely powerful, fast machine. In less than a second,
My Book of Divisibility. THE 2’s Example: 30, 42, 24, 76, 98, Must be an even number Number must end in a 0, 2, 4, 6, or 8.
PROBLEM SOLVING. REDBLUE GREENPINK ORANGEYELLOW Exit.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
IT 210 Week 6 CheckPoint Algorithm Verification To purchase this material link CheckPoint-Algorithm-Verification.
Decision making If.. else statement.
Section 5.4 – Dividing Polynomials
ALGORITHMS AND FLOWCHARTS
1.4 Significant Figures in Calculations
PROGRAM CONTROL STRUCTURE
Algorithms and Flowcharts
Chapter 4: Control Structures
PROBLEM SOLVING CSC 111.
ALGORITHM BASICS- Part 3
1) C program development 2) Selection structure
Decision making If statement.
Chapter 5: Control Structure
Section 7.5: Review.
divide dividend divisor inverse operations quotient
Chapter 1 Whole Numbers.
WJEC GCSE Computer Science
Presentation transcript:

Al-Karma Language School Computer Department Prep. 3

Chapter1   Problem Solving

The use of Branching (Decision) in Flowcharts ???

Decision Most problems include a decision point, such as yes/no question, where two possible answers are available a “yes” and a “no”, In a flowchart the decision point has two paths (branches), each presents one of the possible answers, you can also find more than two answers. .

the word “Pass” will be printed. Exercise (1-1) Write down the Algorithm, and draw a flowchart for a program that will obtain exam scores from the user. Determine whether the score is greater than or equal 50 and display the message “Pass”. First: Define the problem Print the word “Pass”. Output: Input: The score X. Solution: If the value of X is greater than or equal 50; the word “Pass” will be printed.

Second: Algorithm Third: Flowchart   1 Start 2 Enter the values of X 3 If x>= 50 then 3-1 print “ Pass” 4 End Start Enter X X>=50 Yes Print “Pass” No End

Exercise (1-2) First: Define the problem Draw a flowchart for a program that will calculate the division of two numbers. Determine whether the divisor equal (Zero) and display the message “Unknown”. First: Define the problem Print the result of dividing two numbers “R” or print the word “Unknown”. Output: Input: The dividend is “num1”, and the divisor is “num2”. Solution: If num2=0 then print “Unknown”, otherwise print the result of the division “R”.

Third: Flowchart Start End 1 Start 2 Enter the divided num1 Second: Algorithm Third: Flowchart   Start 1 Start 2 Enter the divided num1 3 enter the divisor Num2 4 If Num2= 50 then 4-1 print “ unKnown” 4-2 go to step 7 5 R=Num1/Num2 6 Print R 7 End Enter Num1 Enter Num2 X>=50 Yes Print “unknown” No R = Num1/Num2 Print R End