Three Two One Whenever you attempt to solve a problem, there are certain steps you should follow. 1.Define the problem 2.Propose and evaluate.

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

Andrew C. Samuels, Information Technology Specialist Trainer c/o Ministry of Education Mona High School, Kingston, Jamaica 1 Problem Solving Section 2:
CS 111: Introduction to Programming Midterm Exam NAME _________________ UIN __________________ 10/30/08 1.Who is our hero? 2.Why is this person our hero?
Lecture 2 Introduction to C Programming
Introduction to C Programming
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Introduction to C Programming
ITEC113 Algorithms and Programming Techniques
Introduction to Computers and Programming Lecture 4: Mathematical Operators New York University.
Program Design and Development
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
Introduction to C Programming
Programming Concepts MIT - AITI. Variables l A variable is a name associated with a piece of data l Variables allow you to store and manipulate data in.
ALGORITHMS AND FLOWCHARTS
Adapted from slides by Marie desJardins
Algorithmic Problem Solving CMSC 201 Adapted from slides by Marie desJardins (Spring 2015 Prof Chang version)
INTRODUCTION TO ALGORITHMS PROGRAMMING. Objectives Give a definition of the term algorithm Describe the various parts of the pseudocode algorithm or algorithm.
Introduction to Computational Linguistics Programming I.
Computer Programming 12 Lesson 3 – Computer Programming Concepts By Dan Lunney.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
1 INTRODUCTION TO PROBLEM SOLVING AND PROGRAMMING.
PROBLEM SOLVING & ALGORITHMS CHAPTER 5: CONTROL STRUCTURES - SELECTION.
Building Java Programs Primitive Data and Definite Loops.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
PROBLEM SOLVING WITH LOOPS Chapter 7. Concept of Repetition Structure Logic It is a computer task, that is used for Repeating a series of instructions.
ITEC113 Algorithms and Programming Techniques
Lecture 2: Introduction to C Programming. OBJECTIVES In this lecture you will learn:  To use simple input and output statements.  The fundamental data.
Basic Control Structures
Programming, an introduction to Pascal
`. Lecture Overview Structure Programming Basic Control of Structure Programming Selection Logical Operations Iteration Flowchart.
1 Ethics of Computing MONT 113G, Spring 2012 Session 1 Digital Circuits, binary Numbers Course webpage:
Repetition. Loops Allows the same set of instructions to be used over and over again Starts with the keyword loop and ends with end loop. This will create.
INTRODUCTION TO PROGRAMMING. Program Development Life Cycle The program development life cycle is a model that describes the stages involved in a program.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
The Hashemite University Computer Engineering Department
3 Basics © 2010 David A Watt, University of Glasgow Accelerated Programming 2 Part I: Python Programming.
Chapter 3 AS3 Programming. Introduction Algorithms + data structure =programs Why this formula relevant to application programs created in flash? The.
 2007 Pearson Education, Inc. All rights reserved. A Simple C Program 1 /* ************************************************* *** Program: hello_world.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
Why Repetition? Read 8 real numbers and compute their average REAL X1, X2, X3, X4, X5, X6, X7, X8 REAL SUM, AVG READ *, X1, X2, X3, X4, X5, X6, X7, X8.
Design A software design specifies how a program will accomplish its requirements A design includes one or more algorithms to accomplish its goal.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Algorithms and Pseudocode CS Principles Lesson Developed for CS4 Alabama Project Jim Morse.
7 - Programming 7J, K, L, M, N, O – Handling Data.
INTRODUCTION TO PROBLEM SOLVING
GC211Data Structure Lecture2 Sara Alhajjam.
CS1001 Programming Fundamentals 3(3-0) Lecture 2
Chapter 4: Control Structures
ALGORITHMS AND FLOWCHARTS
Control Structure Senior Lecturer
Arithmetic operations, decisions and looping
Chapter 2 - Introduction to C Programming
Chapter 2 - Introduction to C Programming
Algorithms & Pseudocode
Control Structure Senior Lecturer
Chapter 2 - Introduction to C Programming
1) C program development 2) Selection structure
ALGORITHMS AND FLOWCHARTS
` Structured Programming & Flowchart
Chapter 2 - Introduction to C Programming
Understanding Problems and how to Solve them by using Computers
Chapter 2 - Introduction to C Programming
DATA TYPES AND OPERATIONS
REPETITION Why Repetition?
Primitive Data Types and Operators
3.0 - Design A software design specifies how a program will accomplish its requirements A design includes one or more algorithms to accomplish its goal.
COMPUTING.
Introduction to Python
Presentation transcript:

Three Two One

Whenever you attempt to solve a problem, there are certain steps you should follow. 1.Define the problem 2.Propose and evaluate solutions 3.Determine the most efficient solution. 4.Represent the most efficient solution in the form of an algorithm 5.Test and debug the program 6.Document the program (i.e. a written explanation of how the program works and how to use it)

How do we fry an egg? Write the steps involved in frying an egg.

In defining the problem there must be no ambiguity. The problem should be clear and concise and have only one meaning.

In order to write a program to accomplish a certain task you must analyse the task as a sequence of instructions that can be performed by the computer. These instructions can be divided into three main parts: Input and Storage instructions, Processing instructions and Output instructions.

Input & StorageProcessingOutput

IF a < 10 THEN Read Num ENDIF

WHILE m <> 0 DO PRINT y FOR x = 1 to 5 DO r = x * 10

Textual DataNumerical DataBoolean Data This may include a combination of letters, symbols, and numbers. These are simply numbers. This is data that must be either true or false. (1) Character(1)Real(1) True Examples: a,b,c,$,^,*,2,9,0 Numbers with a decimal point. Examples: 5.6, Examples: The sky is blue – True 10 = – True (2) String(2) Integer(2) False Davis, Shania, ‘Average’ Numbers without a decimal point. Examples: 5, 18, -20 Examples : The dog can fly - False 10 > 25 – False

DATATYPE The Grade a student got in a course, e.g. A,B,C,D,F Character The time Usain Bolt takes to run a 100m race (in seconds) Real The number of books in person’s bagInteger Whether or not a piece of luggage is overweightBoolean The cost of an item in a storeReal A person’s nameString

Mariah

Program Area; Var Base, Height: Integer; Area: Real; BEGIN Area := (Base * Height) / 2; PRINT “Enter the Base”; READ Base; PRINT “Enter the Height”; READ Height; PRINT Area; END.

Arithmetic OperatorOperation +Addition -Subtraction *Multiplication /Division

Relational OperatorOperation >Greater than <Less than >=Greater than or equal to <=Less than or equal to <>Not equal to =Equal to

Logical OperatorOperation ANDAnd OROr NOTNot

Count = 0 While Count < = 10 DO Count = Count + 2 Print Count EndWhile Count = 0 While Count < = 10 DO Count = Count + 2 Print Count EndWhile

CountOutput Count is set as 0; Count < is added to count and 2 is printed. Count < is added to count and 4 is printed. Count < is added to count and 6 is printed. Count < is added to count and 8 is printed. Count < is added to count and 10 is printed. Count <= 10 so the loop is exited.