INTRODUCTION TO PROGRAMMING

Slides:



Advertisements
Similar presentations
CS101: Introduction to Computer programming
Advertisements

CS 240 Computer Programming 1
Chapter 2: Problem Solving
UNIT 2. Introduction to Computer Programming
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Reference :Understanding Computers
CS 240 Computer Programming 1
II N T R O D U C T I O N PP R E T E S T DD E S I G N I N G A L G O R I T H M DD E S I G N I N G F L O W C H A R T GG E N E R A L R U L E S F.
Flowcharts.
ITEC113 Algorithms and Programming Techniques
Chapter 2- Visual Basic Schneider
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
Lecture Notes 8/30/05 Program Design & Intro to Algorithms.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
Review Algorithm Analysis Problem Solving Space Complexity
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
Algorithm & Flowchart.
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
CSEB114: PRINCIPLE OF PROGRAMMING Chapter 2: Problem Solving.
U NDERSTANDING P ROBLEMS AND HOW TO S OLVE THEM BY USING C OMPUTERS.
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
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.
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.
Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms.
© 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.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
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.
Algorithms & Flowchart
Chapter 2: General Problem Solving Concepts
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.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
The Hashemite University Computer Engineering Department
Problem, Problem Solving, Algorithm & Flow Charts –Part 1 Presented By Manesh T Course:101 CS 101CS Manesh T1.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
FLOWCHARTING AND ALGORITHMS
Lecture 3: Developing Procedural Thinking (How to think like a programmer) B Burlingame 16 Feb 2016.
Program Program is a collection of instructions that will perform some task.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Program Design & Development EE 201 C7-1 Spring
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.
Chapter One Problem Solving
Flow Charts Basic Flow Chart Symbols Few sample flowcharts Rules
Chapter One Problem Solving
Flowcharting Guidelines
Chapter 2- Visual Basic Schneider
Algorithms and Flowcharts
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
2.0 Problem Solving PROGRAM DESIGN
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.
Unit# 9: Computer Program Development
SME1013 PROGRAMMING FOR ENGINEERS
Chapter 2- Visual Basic Schneider
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
ME 142 Engineering Computation I
SME1013 PROGRAMMING FOR ENGINEERS
Understanding Problems and how to Solve them by using Computers
Developing a Program.
Basic Concepts of Algorithm
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

INTRODUCTION TO PROGRAMMING

Algorithm It is a list of instructions specifying a precise description of a step by step process that terminates after a finite number of steps for solving an algorithm problem producing the correct answer in the end. It is a recipe for solving problems. A finite set of an instruction that specifies a sequence of operation to be carried out in order to solve a specific problem. An unambiguous procedure specifying a finite number of steps to be taken.

Methods of Specifying Algorithm Pseudocode - specifies the steps of algorithm using essentially natural language of superimposed control structure. Flowchart - a traditional graphical tool with standardized symbols. Show the sequence of steps in an algorithm.

Properties of Algorithm Finiteness - there is an exact number of steps to be taken and has an end. Absence of Ambiguity - means that every instruction is precisely described and clearly specified. Sequence of Execution - instructions are performed from top to bottom. Input and Output - defined the unknowns of the problem is specified and with the expected outcome. Effectiveness - the solution prescribed is guaranteed to give a correct answer and that the specified process is faithfully carried out. Scope Definition - applies to a specific problem or class of problem.

Steps in Program Development State the problem clearly- a problem cannot be solved correctly unless it is being understood. Plan and Write the Logical Order of Instructions - the computer follows the direction exactly at the given sequence. Code the Program - write the programming statements in the desired language. Enter the program into the computer - key in or type the statement into the computer. Run and Debug the program - check if you have the desired output; if not, trace the possible error.

Flowcharting Guidelines The flowchart should flow from top to bottom If the chart becomes complex, utilize connecting blocks Avoid intersecting flow lines Use meaningful description in the symbol

SYMBOL NAME DESCRIPTION Flowcharting Symbols SYMBOL NAME DESCRIPTION TERMINAL Defines the starting and ending point of a flowchart. INITIALIZATION The preparation or initialization of memory space for data processing. INPUT/OUTPUT The inputting of data for processing, and printing out of processed data. PROCESS Manipulation of data(assignments and mathematical computations)

SYMBOL NAME DESCRIPTION Flowcharting Symbols SYMBOL NAME DESCRIPTION FLOW LINES Defines logical sequence of the program. Its points to the ext symbol to be performed ON-PAGE CONNECTOR Connects to the flowchart to avoid spaghetti connection on the same page OFF-PAGE CONNECTOR Connects the flowchart on different page to avoid spaghetti connection DECISION Process conditions using relational operators. Used for trapping and filtering data.

Sample Exercises Sample 1: Write a program that calculates the sum of two input numbers and display the result. Sample 2: Write a program to calculate the area of a circle and display the result. Use the formula: A=πr2 where Pi is approximately equal to 3.1416. Sample 3: Write a program that computes the average of three input quizzes, and then display the result. Sample 4: Write a program that converts the input Fahrenheit degree into its Celsius degree equivalent. Use the formula: C= (5/9)*F-32. Sample 5: Create a program to compute the volume of a sphere. Use the formula: V= (4/3)* πr3 where is pi equal to 3.1416 approximately. The r3 is the radius. Display result. Sample 6: Write a program that converts the input Celsius degree into its equivalent Fahrenheit degree. Use the formula: F= (9/5) * C+32.