An Introduction to Programming with C++1 Beginning the Problem- Solving Process Tutorial 2.

Slides:



Advertisements
Similar presentations
C Programming Technique – Firdaus-Harun.com
Advertisements

An Introduction to Programming with C++ Fifth Edition
PROBLEM SOLVING TECHNIQUES
Introduction to Flowcharting
Flow Control Analysis & Design Tool: Flowcharts
Chapter 1 - An Introduction to Computers and Problem Solving
Documentation Letts Study Guide Information Systems - IT Chapter 19.
Chapter 2- Visual Basic Schneider
Programming Tools Flowcharts Pseudocode Algorithm Chapter 2.
Defining Control Structures
The Program Development Cycle and Program Design Tools
Developing logic (Examples on algorithm and flowchart)
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
Chapter 3 Planning Your Solution
Review Algorithm Analysis Problem Solving Space Complexity
Algorithm & Flowchart.
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
Variables, Constants, Methods, and Calculations Chapter 3 - Review.
CSE 1340 Introduction to Computing Concepts Class 2.
Chapter 2: Problem Solving
Planning for the Solution
Computer Programming TCP1224 Chapter 2 Beginning the Problem-Solving Process.
Chapter 2: Beginning the Problem-Solving Process
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
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
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Programming Concepts Chapter 3.
Chapter 1 Introduction to Structured Design. Introduction  System  A combination of people, equipment, and procedures that work together to perform.
Computational Thinking – Lesson 3 Lesson Objective To be able to construct an algorithm and flowchart for a given problem.
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.
Program Planning and Design. What is Program Planning and Design? Program planning and design is simply knowing what you want to do and how you want to.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
Chapter 5: More on the Selection Structure
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
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.
An Introduction to Programming with C++ Sixth Edition
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.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
An Introduction to Programming with C++1 The Selection Structure Tutorial 6.
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
Problem Solving Flowcharts. Flowcharts Introduction  Flowcharts allow us to create a visual representation of a solution to a problem DRAW  With flowcharts,
CSE 110: Programming Language I Matin Saad Abdullah UB 404.
Program Design & Development EE 201 C7-1 Spring
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Algorithms and Flowcharts
An Introduction to Programming with C++1 More on the Selection Structure Tutorial 7.
An Introduction to Programming with C++ Sixth Edition Chapter 8 More on the Repetition Structure.
Chapter 8: More on the Repetition Structure
GC101 Introduction to computers and programs
INTRODUCTION TO PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
The Selection Structure
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.
An Introduction to Visual Basic .NET and Program Design
Chapter 2- Visual Basic Schneider
Chapter 2- Visual Basic Schneider
Problem Solving.
Introduction to Programming
Basic Concepts of Algorithm
Programming Logic and Design Eighth Edition
Introduction to Programming
Introduction to Flowcharts
Presentation transcript:

An Introduction to Programming with C++1 Beginning the Problem- Solving Process Tutorial 2

An Introduction to Programming with C++2 Objectives Explain the problem-solving process used to create a computer program Analyze a problem Complete an IPO chart Plan an algorithm using pseudocode and flowcharts Desk-check an algorithm

An Introduction to Programming with C++3 Concept Lesson

An Introduction to Programming with C++4 Problem Solving/Solving Everyday Problems Steps include: –Analysis –Planning –Review –Implementation –Evaluation –Modification

An Introduction to Programming with C++5 Analysis and Planning

An Introduction to Programming with C++6 Modified Algorithm

An Introduction to Programming with C++7 Creating Computer Solutions to Problems

An Introduction to Programming with C++8 Analyzing the Problem Purpose of analyzing problem: –to determine the goal –to determine the items needed to achieve goal

An Introduction to Programming with C++9 Analyzing the Problem (Cont.)

An Introduction to Programming with C++10 IPO (Input, Processing, Output) Charts Used by programmers to organize and summarize the results of a problem analysis To determine input: –Search the problem specification for an answer to the following question: What information will the computer need to know to print, display, or store the output items?

An Introduction to Programming with C++11 IPO Chart with Input and Output

An Introduction to Programming with C++12 Determining Important Information If not sure if an item of information is important, ask yourself this question: If I didn’t know this information, could I still solve the problem? When reading a problem specification, it helps to use a pencil to lightly cross out unnecessary information

An Introduction to Programming with C++13 Problem Specification

An Introduction to Programming with C++14 Problem Specification Lacking Information

An Introduction to Programming with C++15 Problem Specification with Input not Stated

An Introduction to Programming with C++16 Planning the Algorithm Processing item - an intermediate value that the algorithm uses when processing the input into the output Pseudocode - a tool programmers use to help them plan an algorithm Flowchart - uses standardized symbols to show the steps the computer needs to take to accomplish the program’s goal

An Introduction to Programming with C++17 Completed IPO Chart

An Introduction to Programming with C++18 IPO Chart with Flow Chart

An Introduction to Programming with C++19 Flowchart Symbols Flowlines - used to connect symbols Start/stop symbol (oval) – indicates beginning of flowchart Process symbols (rectangles) – used to represent tasks such as calculations Input/output symbol (parallelogram) - Used to represent input tasks

An Introduction to Programming with C++20 Solving Sarah’s Problem

An Introduction to Programming with C++21 IPO Chart for Problem Specification

An Introduction to Programming with C++22 Hints for Planning Algorithms

An Introduction to Programming with C++23 Desk-checking the Algorithm Reason for desk-checking: –To verify that the program is not missing any steps –To verify that the existing steps are correct and in the proper order

An Introduction to Programming with C++24 Desk-check Table with New Weekly Pay

An Introduction to Programming with C++25 Results of Second Desk-check

An Introduction to Programming with C++26 The Gas Mileage Problem

An Introduction to Programming with C++27 The Gas Mileage Problem Analyze the problem looking for nouns and adjectives that represent both input and output Output should answer the following question: What does the user want to see printed on paper, displayed on the screen, or stored in a file? Input should answer the following question: What information will the computer need to know to print, display, or store the output items?

An Introduction to Programming with C++28 IPO Chart

An Introduction to Programming with C++29 Completed Desk-check Table

An Introduction to Programming with C++30 Application Lesson

An Introduction to Programming with C++31 Problem Specification and Sample Calculation

An Introduction to Programming with C++32 Analyze the Problem Answer the following questions: –What does the user want to see printed on the printer, displayed on the screen, or stored in a file? –What information will the computer need to know to print, display, or store the output items?

An Introduction to Programming with C++33 IPO Chart Showing Input and Output Items

An Introduction to Programming with C++34 Planning the Algorithm Algorithm – the step-by-step instructions that will transform the input into the output Processing item - an intermediate value that the algorithm uses when processing the input into the output

An Introduction to Programming with C++35 IPO Chart Showing the Partially Completed Algorithm

An Introduction to Programming with C++36 Completed IPO Chart

An Introduction to Programming with C++37 Desk-checking the Algorithm Before desk-checking: –choose a set of sample data for the input values

An Introduction to Programming with C++38 Results of First Desk-check

An Introduction to Programming with C++39 Results of Second Desk-check

An Introduction to Programming with C++40 Another Correct Algorithm

An Introduction to Programming with C++41 Summary Explain the problem-solving process used to create a computer program Problem analysis techniques Complete an IPO chart Use of algorithms (pseudocode) and flowcharts Desk-checking techniques