INTRODUCTION TO PROBLEM SOLVING

Slides:



Advertisements
Similar presentations
Andrew C. Samuels, Information Technology Specialist Trainer c/o Ministry of Education Mona High School, Kingston, Jamaica 1 Problem Solving Section 2:
Advertisements

PSEUDOCODE & FLOW CHART
8 Algorithms Foundations of Computer Science ã Cengage Learning.
ITEC113 Algorithms and Programming Techniques
Program Design and Development
Chapter 2: Input, Processing, and Output
Chapter 1 Program Design
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Simple Program Design Third Edition A Step-by-Step Approach
Planning for the Solution
Software Life Cycle What Requirements Gathering, Problem definition
ITEC113 Algorithms and Programming Techniques
Chapter 2: General Problem Solving Concepts
Basic problem solving CSC 111.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
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.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
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,
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
Algorithms and Pseudocode
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Algorithms and Flowcharts
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Learning outcomes 5 Developing Code – Using Flowcharts
ALGORITHMS AND FLOWCHARTS
CMSC201 Computer Science I for Majors Lecture 02 – Algorithmic Thinking Prof. Katherine Gibson Based on slides by Shawn Lupoli and Max Morawski at UMBC.
Topic: Introduction to Computing Science and Programming + Algorithm
Topics Designing a Program Input, Processing, and Output
GC101 Introduction to computers and programs
Topic: Introduction to Computing Science and Programming + Algorithm
Introduction to the C Language
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Chapter 2: Input, Processing, and Output
Chapter 2 - Introduction to C Programming
Python: Control Structures
GC211Data Structure Lecture2 Sara Alhajjam.
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
Introduction To Flowcharting
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
ALGORITHM Basic CONCEPTS of Basic Concepts of Algorithm
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
Chapter 2 - Introduction to C Programming
ALGORITHMS AND FLOWCHARTS
Print slides for students reference
Introduction to the C Language
Unit# 9: Computer Program Development
Algorithm An algorithm is a finite set of steps required to solve a problem. An algorithm must have following properties: Input: An algorithm must have.
Algorithms & Pseudocode
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
ALGORITHMS AND FLOWCHARTS
Introduction to Algorithms and Programming
Faculty of Computer Science & Information System
ME 142 Engineering Computation I
Problem Solving Skill Area 305.1
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Flowcharts and Pseudo Code
Topics Designing a Program Input, Processing, and Output
Introduction to Programming
Topics Designing a Program Input, Processing, and Output
Chapter 2: Input, Processing, and Output
Basic Concepts of Algorithm
Presentation transcript:

INTRODUCTION TO PROBLEM SOLVING GRADE 11 SEPTEMBER REVIEW OF TOPIC SOURCES: Information Technology for csec 3rd ed Skeete and Skeete CSEC syllabus, Oxford IT for CSEC

CSEC SPECIFIC OBJECTIVES (1-6) Students should be able to: 1. outline the steps in problem-solving; CONTENT Definition of the problem; propose and evaluate solutions; determination of the most efficient solution; develop and represent algorithm; test and validate the solution. 2. decompose a simple problem into its significant parts(components); The components are: input; process; storage; output

SPECIFIC OBJECTIVES (CONT’D) 3. distinguish between variables and constants; CONTENT Variable: an area of storage whose value can change during processing; the value of a constant never changes.

SPECIFIC OBJECTIVES (CONT’D) 4. use appropriate data types; CONTENT Integers, floating point (real), characters, literals. 5. explain the concept of algorithms; Definition of algorithms; Characteristics: finite number of steps, precise, unambiguous, flow of control from one process to another, terminate.

SPECIFIC OBJECTIVES (CONT’D) 6. Identify ways of representing algorithms; Representation of algorithms as Pseudocode or Flowcharts; Use of flowchart symbols: input/output, process, decision, directional arrows. Pseudocode - Use of: Read, Input, Store Write, Output, Display, If-then; If-then- else; For loop; while loop; (questions which require nested conditionals or nested loops will not be asked).

What is a computer program? A computer program is a set of computer instructions, which are used for solving a problem. The program directs the computer to perform the actions that are needed to arrive at a solution. The number of instructions required to solve a problem depends on the complexity of the problem. These instructions may range from a few to many hundreds or thousands.

What is a problem (in computing) One definition is: A discrepancy between what is required and what exists. ________________________________________________________ A computer program is meant to solve a problem. Think of a programming problem in the same light as you would think of a mathematical problem. It's not something bad(though some people may say otherwise). Rather, it is something that needs to be solved or a task that needs to be accomplished.

Phases of program design How should you design programs? Whenever you are designing programs, there are two main phases: 1 The problem-solving phase. Ideally you shouldn't touch the computer during this phase. 2. the implementation phase (covered in section two of your syllabus). This is where you take the designs you came up with during the problem-· solving phase and implement them on the computer.

The five main problem-solving steps 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 the algorithm.

What is an algorithm? An algorithm is a formal sequence of instructions that defines a solution to a problem. The word 'a' is emphasized because a problem may have more than one solution. In a sense, an algorithm is sort of like a recipe - but for computers. You will learn a number of ways to represent algorithms, but whatever method you use there are certain characteristics that are required.

Defining the problem In order for you to come up with an algorithm to solve a problem, you must first have a clear understanding of what the problem is. The first thing you have to do is to obtain a problem statement (a clear definition of the problem that needs to be solved). At this level it will usually be provided for you, but in the real world the programmer would have to work with his client to come up with one.

Defining the problem Here are some (very simple) examples of problem statements: The program must read two numbers and print the larger of the two. Write a program that reads three numbers and displays their average.

Determining the input, output, processing and storage The next step in defining the problem is to break it down into its main components: 1 Inputs - the data you are provided with or have to obtain from the user. Some words that help you to identify the inputs are: read, input, enter, given, accept 2 Outputs - the results that should be produced 3 Processing - the tasks that must be performed, i.e. what must be done with the inputs to get the outputs 4 Storage - the data that must be stored

Defining diagrams One way of illustrating the main components of a problem is by using a defining diagram. A defining diagram is a table with three columns: 'Input', 'Processing' and 'Output'. Consider the following problem statement: Write a program that reads two numbers and prints the total. Even this simple statement requires some detective work to figure out the input, output and especially the processing.

Input The word 'read' tells us that the inputs will be in the form of two numbers. For reasons that will be explained later, it's helpful to give the inputs names, so we'll call them numl and num2. Output The desired result is the total, so we'll call the output 'total'.

Processing Each task that must be performed counts as processing. Reading the two numbers is processing and so is printing the total. But is that everything? The total doesn't magically appear. You have to do something to the inputs to obtain the total. So there is an in- between step that is implied - calculating the total. Therefore, the defining diagram would look like this:

Input Processing Output two numbers, say Read two numbers. total 1 Read two numbers. total numl, num2 2 Calculate the total.   3 Print the total.