How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.

Slides:



Advertisements
Similar presentations
PROBLEM SOLVING TECHNIQUES
Advertisements

Chapter 1 - VB 2008 by Schneider1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and.
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2 - Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2 - Problem Solving
ITEC113 Algorithms and Programming Techniques
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider
Computers: Tools for an Information Age
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 1 Program Design
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
Programming Logic and System Analysis
Fundamentals of C programming
1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and Files 1.3 Program Development.
CS 0004 –Lecture 8 Jan 24, 2011 Roxana Gheorghiu.
Chapter 1 - VB 2008 by Schneider1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights ReservedAn Introduction.
Chapter 2 - VB.NET by Schneider1 Chapter 2 - Problem Solving Program Development Cycle Programming Tools.
Introduction to Algorithms By Mr. Venkatadri. M. Two Phases of Programming A typical programming task can be divided into two phases: Problem solving.
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.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.
Chapter 11 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and Files 1.3 Program Development.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
1 Program Planning and Design Important stages before actual program is written.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 1 - VB 2008 by Schneider1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and.
The Art of Programming. The process of breaking problems down into smaller, manageable parts By breaking the problem down, each part becomes more specific.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
The Hashemite University Computer Engineering Department
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
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.
MIT App Inventor Lesson 3 Algorithms Variables Procedures.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
ALMAJMA'AH UNIVERSITY College of Science and Humanitarians Studies in Alghat Information Technology Section (211Tal course)
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
 Problem Analysis  Coding  Debugging  Testing.
ALMAJMA'AH UNIVERSITY College of Science and Humanitarians Studies in Alghat Management Information System Section (211 NMA course) Introduction to Programming.
ICS 3UI - Introduction to Computer Science
Chapter 2- Visual Basic Schneider
Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.
Lecture 2 Introduction to Programming
Chapter 1 - An Introduction to Computers and Problem Solving
Algorithm Algorithm is a step-by-step procedure or formula or set of instruction for solving a problem Its written in English language or natural language.
Introduction to Computer Programming
An Introduction to Visual Basic .NET and Program Design
Unit# 9: Computer Program Development
Problem Solving Techniques
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Basic Concepts of Algorithm
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step at a time Complex “Human” Algorithms must be broken down into simple step-by-step instructions BEFORE they can be translated into computer code

Algorithm Definition: An algorithm is a procedure consisting of a finite set of unambiguous rules (instructions) which specify a finite sequence of operations that provides the solution to a problem, or to a specific class of problems for any allowable set of input quantities (if there are inputs). In other word, an algorithm is a step-by-step procedure to solve a given problem

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 3 Computer Program A computer program may also be called: – Project – Application – Solution

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 4 Program Development Cycle Software refers to a collection of instructions for the computer The computer only knows how to do what the programmer tells it to do Therefore, the programmer has to know how to solve problems

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 5 Performing a Task on the Computer Determine Output Identify Input Determine process necessary to turn given Input into desired Output INPUTPROCESS OUTPUT

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 6 Problem-solving: Approach like algebra class How fast is a car traveling if it goes 50 miles in 2 hours? Input: the distance and time the car has traveled Process: speed = distance / time Output: a number giving the speed in miles per hour

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 7 Pictorial representation of the problem solving process

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 8 Program Planning A recipe is a good example of a plan Ingredients and amounts are determined by what you want to bake Ingredients are input The way you combine them is the processing What is baked is the output

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 9 Program Planning Tips Always have a plan before trying to write a program The more complicated the problem, the more complex the plan must be Planning and testing before coding saves time coding “Program in Haste - debug forever.”

Programming Task A typical programming task can be divided into two phases: Problem solving phase – produce an ordered sequence of steps that describe solution of problem i.e. an algorithm Implementation phase – implement the program in some programming language

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 11 Program Development Cycle 1. Analyze: Define the problem. 2. Design: Plan the solution to the problem. 3. Choose the interface: Select the objects (text boxes, buttons, etc.). 4. Code: Translate the algorithm into a programming language. 5. Test and debug: Locate and remove errors. 6. Complete the documentation: Organize all the materials that describe the program.

Expressing the Algorithms A “Standard” way of describing an algorithm must exist if we expect our solution to be understood by others easily There are three main standards in programming: – PSEUDOCODE – FLOWCHARTS – PROGRAMMING LANGUAGE

Pseudocode Pseudocode is a generic way of describing an algorithm without use of any specific programming language syntax. “Pseudo” means “pretend” or “false” Pseudo Code is pretend or false computer code; generic English-like terms that are somewhat like computer code Pseudo Code is not as standardized as flowcharts, and does not facilitate the breaking down of problems as well as a flowchart does

Pseudocode Example Problem Statement: Obtain a number from the user, then display twice this number back to the user. 1.display prompt to user 2.read number 3.result = number * 2 4.display result

Pseudocode Advantages – Almost as easy to learn as expressing the Algorithm in English – Easier to translate into a programming language than stating the solution in English – The pseudo-code statements closely resemble most procedural programming languages Disadvantages – This technique relies on your understanding of the procedural programming languages. For someone learning their first programming language, this can be frustrating.

Flowcharts A Flowchart is a Visual Representation of an algorithm A Flowchart uses easy-to-understand symbols to represent actions on data and the flow of data Flowcharts aid in breaking down a problem into simple steps

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 17 Flowchart symbols

Chapter 2 - VB 2005 by Schneider- modified by S. Jane '08 18 Flowchart Symbols (continued)

Example Problem Statement: Obtain a number from the user, then display square of this number back to the user.