Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.

Slides:



Advertisements
Similar presentations
CS101: Introduction to Computer programming
Advertisements

Overview of Programming and Problem Solving ROBERT REAVES.
Chapter 2: Problem Solving
Chapter 2: Problem Solving
Chapter 1 - An Introduction to Computers and Problem Solving
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
Chapter 3 Planning Your Solution
PRE-PROGRAMMING PHASE
1 L07SoftwareDevelopmentMethod.pptCMSC 104, Version 8/06 Software Development Method Topics l Software Development Life Cycle Reading l Section 1.4 – 1.5.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Chapter 2: Problem Solving
CSEB114: PRINCIPLE OF PROGRAMMING Chapter 2: Problem Solving.
Chapter 2: Problem Solving
U NDERSTANDING P ROBLEMS AND HOW TO S OLVE THEM BY USING C OMPUTERS.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
CSC-115 Introduction to Computer Programming
Programming Lifecycle
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
Programming Concepts Chapter 3.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
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.
CMSC 1041 Algorithms II Software Development Life-Cycle.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Module 4 Part 1 Introduction To Software Development : Systems Analysis & Design Introduction To Software Development : Systems Analysis & Design.
กระบวนการแก้ปัญหาด้วย คอมพิวเตอร์ 3 พฤษภาคม :00-17:00.
ALGORITHM List of instructions for carrying out some process step by step. A sequence of instructions which has a clear meaning and can performed with.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Chapter 2: General Problem Solving Concepts
Definition of Terms Software/Programs Programs that directs the operation of a computer system Set of instructions Codes Programming Process of planning,
CMSC 104: Peter Olsen, Fall 99Lecture 9:1 Algorithms III Representing Algorithms with pseudo-code.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
Principles of Programming - NI July Chapter 2: Problem Solving In this chapter you will learn about: Introduction to Problem Solving Software development.
1 Program Planning and Design Important stages before actual program is written.
CS 100 Introduction to Computing Seminar September 21, 2015.
 In this chapter you will learn about:  Introduction to Problem Solving  Software development method (SDM)  Specification of needs  Problem analysis.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
CSEB114: Principle of programming
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Programming Fundamentals Introduction to Problem Solving  Programming is a problem solving activity. When you write a program, you are actually writing.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
An Introduction to Programming with C++1 Beginning the Problem- Solving Process Tutorial 2.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 1 An Introduction to Visual Basic.NET and Program Design.
 Problem Analysis  Coding  Debugging  Testing.
ICS 3UI - Introduction to Computer Science
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Algorithms and Flowcharts
Programming Fundamentals
Algorithm and Ambiguity
An Introduction to Visual Basic .NET and Program Design
ALGORITHMS AND FLOWCHARTS
Introduction to Problem Solving
VISUAL BASIC – CHAPTER ONE NOTES An Introduction to Visual Basic
ALGORITHMS AND FLOWCHARTS
Design and Implementation
Chapter 1 Introduction(1.1)
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
The Programming Process
Understanding Problems and how to Solve them by using Computers
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
ICT Gaming Lesson 2.
Basic Concepts of Algorithm
Presentation transcript:

Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer to solve something for you. Problem solving is the process of transforming the description of a problem into a solution 1

2 A sequence of instructions specifying the steps required to accomplish some task Named after: Muhammad ibn Musa al-Khwarizmi of Khowarezm (now Khiva in Uzbekistan) Circa C.E. (Common Era) Algorithm

3 Algorithm -- Examples A cooking recipe Assembly instructions for a model The rules of how to play a game Directions for driving from A to B A car repair manual

4 Algorithms are not Programs Algorithms are well-defined sequence of unambiguous instructions must terminate (to produce a result) Algorithm description relies on a well-defined “instruction language” Example: Manual Addition Describe the method!

5 Algorithms and Languages the very same Algorithm may look very different when described (or implemented) in different (programming-) languages, e.g. “Sum up the numbers between 1 and 10 by adding each of them to a total starting with 0” s  +/(  10) APL-style int s:=0; for i = 0 to 10 do s:= s+i; end Pascal-style

Software Development Method (SDM) For programmer, we solve problems using Software Development Method (SDM), which is as follows: 1.Specify the problem requirements. 2.Analyze the problem. 3.Design the algorithm to solve the problem. 4.Implement the algorithm. 5.Test and verify the completed program. 6.Documentation 6

1. Requirement Specification Specifying the problem requirements requires you to state the problem clearly and to gain the understanding of what to be solved and what would be the solution. When specifying problem requirement, we ask ourselves the following questions: – What the problem is. – What the solution should provide. – What is needed to solve it. – If there are constraints and special conditions. 7

Problem Analysis Analyzing the problem require us to identify the following: – Input(s) to the problem, their form and the input media to be used – Output(s) expected from the problem, their form and the output media to be used – Special constraints or conditions (if any) – Any formulas or equations to be used 8

Designing algorithm Designing algorithm to solve the problem requires you to develop a list of steps, arranged in a specific logical order which, when executed, produces the solution for a problem. 9

Control Structure An algorithm can be represented using Pseudocode or Flowchart. 3 control structures: sequence, selection and repetition. 10

Control Structure Sequence: A series of steps or statements that are executed in the order they are written in an algorithm. Selection: Defines two courses of action depending on the outcome of a condition. A condition is an expression that is, when computed, evaluated to either true or false. Repetition: Specifies a block of one or more statements that are repeatedly executed until a condition is satisfied. 11

Flowcharts Flowcharts is a graph used to depict or show a step by step solution using symbols which represent a task. It is an alternative to pseudocoding. 12

Flowchart Symbols 13 Terminal symbol - indicates the beginning and end points of an algorithm. Process symbol - shows an instruction other than input, output or selection. Input-output symbol - shows an input or an output operation. Disk storage I/O symbol - indicates input from or output to disk storage.

Flowchart Symbols cont… 14 Selection symbol - shows a selection process for two-way selection. Flow lines - indicate the logical sequence of execution steps in the algorithm.

Implementation The process of implementing an algorithm by writing a computer program using a programming language (for example, using C language) The output of the program must be the solution of the intended problem 15

Testing and Verification Program testing is the process of executing a program to demonstrate its correctness Program verification is the process of ensuring that a program meets user- requirement After the program is compiled, we must execute the program and test/verify it with different inputs before the program can be released to the public or other users 16

Documentation Writing description that explain what the program does. Can be done in 2 ways: – Writing comments between the line of codes – Creating a separate text file to explain the program Important not only for other people to use or modify your program, but also for you to understand your own program after a long time (believe me, you will forget the details of your own program after some time...) 17