MELJUN CORTES 's - Algorithm Flow Charting Handouts

download MELJUN CORTES 's -  Algorithm Flow Charting Handouts

of 17

Transcript of MELJUN CORTES 's - Algorithm Flow Charting Handouts

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    1/17

    FACTSHEET in IT 102 COMPUTER PROGRAMMING 1 Instructor: MELJUN CORTES

    Date: JUNE 8, 2010" ALGORITHM "ALGORITHM a finite set of instruction that specify a sequence of operation to be carried out in order to

    solve specific problem or class of problem.

    ALGORITHM is a finite or countable step-step list of well-defined instruction for solving a particular for

    solving a particular problem.

    ALGORITHM - a finite number of step-by-step direction that are sure to solve a particular type of problem.

    ALGORITHM a way of solving a problem.

    ALGORITHM a recipe for solving problem.

    2 Ways Representing an ALGORITHM:

    1.) FLOWCHARTS are pictorial representation of the flow of logic in solving a problem.- is utilized special symbols which represent specific function performed by the

    computer.

    - are presented as a tools for the expression of algorithm.

    2.) PSEUDOCODE a textual presentation of an algorithm where the action to be taken bythe machine are specified in manner close to a natural language with the control structures imposing

    the logic.

    -an English language that trace out the problem.

    FLOWCHARTING one of the useful tools have been developed to determine and test thevalidity of the statement entered sequentially in a program.

    - a tool for problem solving.

    Complexity of Algorithm the function which gives the running time and space in term of the input size.

    Time & Space it uses are two major measures of the efficient of an algorithm.

    2 Types of FLOWCHART :1.) SYSTEM FLOWCHART the summary of solving the problem usually used by theSystem Analyst to picture the problem.

    2.) PROGRAM FLOWCHART the detailed steps in solving the problem.

    Coverage for PRELIM EXAM

    Study & memorize this note

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    2/17

    8 Program Flowchart used by the programmer: ( 8 Uses of flowcharting)

    1.) provides communications

    2.) provides an overview

    3.) provides program revision

    4.) provides program documentation

    5.) provides a permanent recording of program logic6.) aids in algorithm developments and experimentation

    7.) checks program logic

    8.) facilitates coding

    6 - What are the step of Problem Analyst? (Being as an IT student, youbecome a System Analyst someday) ( What are the preparation for

    programming? )6 Areas that the problem analyst or programmer must consider in thecourse of developing acomputerized solution to a problem:

    1. Problem Analysis2. Algorithms and Flowcharting3. Coding4. Keyboarding5. Executing & Debugging the application

    6. Documentation2 Types of Problem Solving:

    1.) Modular Return

    2.) Top Down

    COMPUTER is an electronic storing device that manipulates data within its central processing unitbased on a set of instructions and produced timely and accurate information.

    PROGRAM set of instruction tells the computer how to solve a particular problem.ALGORITHM is a step-by-step specification of the solution to a given problem.FLOWCHART is figurative representation of an algorithm.PROCEDURE the follower is the doer/user.FLOWCHARTING one of the useful tools have been developed to determine & test the validity ofthe statement entered sequentially in a program.

    - a tool for problem solving.

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    3/17

    * * *P R O G R A M D E V E L O P M E N T * * *What is a program?PROGRAM is a set of instruction that tells to the computer how to solve a particular problem.

    PROGRAM is just an algorithm written in a language that can be fed into a computer.

    PROGRAM is similar to a procedure.

    PROGRAM the follower of a program is the computer.

    Procedure the follower is the doer/user.

    6 Steps in Program Development: 3 Problem Solving Process:1. Problem Analysis 1.) Analyzing the problem

    2. Problem Designing 2.) Designing the solution3. Program Coding 3.) Test the solution

    4. Program Testing

    5. Program Implementation 3 Characteristics of theProgrammer:6. Program Documentation

    1.) LOGIC

    4 Program Designing Tools: 2.) PERSEVERANCE2.) Programming Language C++/JAVA/Basic

    1.) Flowchart

    2.) Pseudocode3.) Decision Table ALGORITHM a set of instruction that leads to a solution to a given problem

    4.) Narrative * In short, ALGOS are the SOLUTION to a problem.

    * In can be expressed in any language or symbolism.

    4 ELEMENTS of a PROGRAM:1. Action/Verbal FLOWCHART is a figurative representation of an algorithm.

    2. Data

    3. Sequence PROGRAM the follower is computer.

    4. Language

    PROCEDURE the follower is doer/user/human being

    7 HIERARCHY of INFORMATION:1.) bit smallest unit of information.

    - the acronym of Binary Digit (0 & 1)

    2.) byte an eight (8) adjacent bits.- 1 character ( ex. Letter "A" or "a" in the Keyboard )

    3.) character is a unit of information.

    4.) field it is an item of information representing a data.

    5.) record it is a collection of fields.

    6.) file is a collection of records.

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    4/17

    7.) database an organized collection of related information or data.

    Rules in Forming a Variable Name:

    1. must start with an alphabetic character; may be followed by another letter or a number.

    2. must be unique

    3. must not be a reserved word or keyword of C++ programming language

    4. must not contain any special character except the tags.

    VARIABLE are unique symbols that identify a memory location in RAM.

    - are symbols that can hold numbers or other types of data.

    2 types of VARIABLE:

    1.) String Variable2.) Numeric Variable

    3 kinds of Control Structures:

    1.) SEQUENCE consists of one or more instructions which are to be executed in sequence,

    one after

    aother.

    - is shown by one or more processes, predefined processes and input/out

    The videos in this section deal with algorithms and algorithm analysis. Generally speaking, an algorithm is a well-defined series of steps to performing a specific task. In computer science, these steps are typically composed ofinstructions, loops, and branches, which can be described in pseudocode. Algorithms are analyzed for speed viamathematical methods for counting the number of steps on a large scale, also known as asymptotic analysis.

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    5/17

    Java Computer Terms

    There are many acronyms floating around the internet, universities, and Java programmers' cubes these days.

    Sometimes, they can be quite confusing and downright misleading. Also, Sun MicroSystems has made it just about as

    hard as possible to keep anything straight in the Java language with, for instance, their desire to version their products

    in the strangest ways (1.1, 1.2, 1.3, 1.4, 5.0, 6). So, to help clear the haze and hopefully help set and keep you

    straight on your path, here are some definitions of the more commonly-used terms. Email me with corrections.

    COM: Component Object Model. This technology allows interprocess communications between applications written in

    any programming language. Introduced by Microsoft in the early 1990s.

    Distributed Environment: A set of computers (2+), either on the same table, in the same company, or across the

    globe from one another, that are able to communicate with each other via a network. The internet is a prime example

    of a distributed environment.

    J2EE: Java 2 Platform, Enterprise Edition, an older name forJava EE.

    J2ME: Java 2 Micro Edition. This is an older name forJava ME.

    Java 2: Java 2 Platform, Standard Edition. This name was dropped after version 1.4, and now is calledJava SE.

    Java 2 SDK: Java 2 Software Development Kit. This is an older name forJava SE JDK.

    Java EE:Java Enterprise Edition. The latest download of version 1.4 encompasses the Java SE plus ahost of other

    technologies, listed here (I will define these when time permits):

    A server

    Web Services Technologies

    Java API for XML-Based Web Services (JAX-WS) 2.0

    Java API for XML-Based RPC(JAX-RPC) 1.1

    Java Architecture for XML Binding (JAXB) 2.0

    SOAP with Attachments API for Java (SAAJ)

    Streaming API for XML JavaServer Faces 1.2 (JSF)

    JavaServer Pages 2.1 (JSP)

    Java Servlet 2.5

    Enterprise JavaBeans 3.0 (EJB)

    J2EE Connector Architecture 1.5

    JavaBeans Activation Framework (JAF) 1.1

    JavaMail (Email API)

    Java Message Service API (JMS)

    Java Persistence API

    Java Transaction API (JTA)

    J2EE Application Deployment and Management

    Java Authorization Contract for Containers

    mailto:[email protected]://xoax.net/comp/java/terms.php#JavaEE%23JavaEEhttp://xoax.net/comp/java/terms.php#JavaEE%23JavaEEhttp://xoax.net/comp/java/terms.php#JavaME%23JavaMEhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://java.sun.com/javaee/http://java.sun.com/javaee/http://java.sun.com/javaee/http://java.sun.com/javaee/technologies/http://java.sun.com/javaee/technologies/http://java.sun.com/javaee/technologies/http://xoax.net/comp/java/terms.php#RPC%23RPChttp://xoax.net/comp/java/terms.php#RPC%23RPChttp://xoax.net/comp/java/terms.php#SOAP%23SOAPhttp://xoax.net/comp/java/terms.php#SOAP%23SOAPmailto:[email protected]://xoax.net/comp/java/terms.php#JavaEE%23JavaEEhttp://xoax.net/comp/java/terms.php#JavaME%23JavaMEhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://java.sun.com/javaee/http://java.sun.com/javaee/technologies/http://java.sun.com/javaee/technologies/http://xoax.net/comp/java/terms.php#RPC%23RPChttp://xoax.net/comp/java/terms.php#SOAP%23SOAP
  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    6/17

    Java ME:Java Micro Edition. This is used for programming mobile devices such as cell phones, PDAs, and TV set-

    top boxes, etc.

    Java SDK: Java Software Development Kit. It means the same thing as Java SE JDK.

    Java SE:Java Software Environment.This encompasses both theJDKand the JRE. Sun MicroSystems changed the

    naming conventions and versioning over the years. Here are the full lists of Java JDK and then Java JRE versions:

    Java SE JDK 6

    Java SE JDK 5.0

    J2SDK (aka Java 2 SDK, Java 2 JDK, or J2SE) 1.4

    J2SDK (aka Java 2 SDK, Java 2 JDK, or J2SE) 1.3

    J2SDK (aka Java 2 SDK, Java 2 JDK, or J2SE) 1.2

    JDK 1.1

    JRE 6

    JRE 5.0

    J2RE 1.4

    J2RE 1.3

    J2RE 1.2

    JRE 1.1

    Java Web Start: A reference implementation based on theJNLP technology. On your web server, you will need to

    put only a file with a .jnlp extension to allow users, from your website, to download and run any Java application you

    specify.

    JDK: Java Development Kit. This allows you to compile and run a Java application on your machine. May either refer

    in a general way to theJava SE JDK, or this may refer to the JDK version 1.1 (very obsolete and no one [that I know

    of] programs using this anymore).

    JNLP:Java Network Launching Protocol.

    JRE: Java Runtime Environment. This allows you to run a Java application on your machine, but it does not allow you

    to compile a Java application.

    RMI: Remote Method Invocation. This technology is specific to Java, and does basically the same thing as RPC.

    RPC: Remote Procedure Call. This technology makes it possible for a client machine to talk to a server. In Java, there

    is also something similiar called RMI.

    SOAP: Simple Object Access Protocol. Allows Java objects and COM objects to talk to each other across a

    distributed environment.

    Basic Data Types

    here are two kinds of data types in Java: primitives and objects. Primitive variables hold only one piece of data (i.e.,

    an integer, a decimal number, a single character), whereas objects can hold a collection of many types of data. To

    start out with, we will look at primitives.

    There are eight primitive data types in Java (reprinted from Java in a Nutshell):

    http://java.sun.com/javame/index.jsphttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://java.sun.com/javase/downloads/index.jsphttp://java.sun.com/javase/downloads/index.jsphttp://java.sun.com/javase/downloads/index.jsphttp://xoax.net/comp/java/terms.php#JDK%23JDKhttp://xoax.net/comp/java/terms.php#JDK%23JDKhttp://xoax.net/comp/java/terms.php#JDK%23JDKhttp://xoax.net/comp/java/terms.php#JRE%23JREhttp://xoax.net/comp/java/terms.php#JNLP%23JNLPhttp://xoax.net/comp/java/terms.php#JNLP%23JNLPhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://java.sun.com/products/javawebstart/download-spec.htmlhttp://xoax.net/comp/java/terms.php#COM%23COMhttp://www.amazon.com/gp/product/0596007736?ie=UTF8&tag=xoaxnet-20&link_code=as3&camp=211189&creative=373489&creativeASIN=0596007736http://www.amazon.com/gp/product/0596007736?ie=UTF8&tag=xoaxnet-20&link_code=as3&camp=211189&creative=373489&creativeASIN=0596007736http://java.sun.com/javame/index.jsphttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://java.sun.com/javase/downloads/index.jsphttp://xoax.net/comp/java/terms.php#JDK%23JDKhttp://xoax.net/comp/java/terms.php#JRE%23JREhttp://xoax.net/comp/java/terms.php#JNLP%23JNLPhttp://xoax.net/comp/java/terms.php#JavaSE%23JavaSEhttp://java.sun.com/products/javawebstart/download-spec.htmlhttp://xoax.net/comp/java/terms.php#COM%23COMhttp://www.amazon.com/gp/product/0596007736?ie=UTF8&tag=xoaxnet-20&link_code=as3&camp=211189&creative=373489&creativeASIN=0596007736
  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    7/17

    Type Contains Default Size Range

    boolean

    true or false false 1 bit NA

    char Unicode character \u0000 16 bits \u0000 to \uFFFF

    byte Signed integer 0 8 bits -128 to 127

    short Signed integer 0 16 bits -32768 to 32767

    int Signed integer 0 32 bits -2147483648 to 2147483647

    long Signed integer 0 64 bits -9223372036854775808 to 9223372036854775807

    float IEEE 754 floating point 0.0 32 bits +/- 1.4E-45 to +/- 3.4028235E+38

    double IEEE 754 floating point 0.0 64 bits +/- 4.9E-324 to +/- 1.7976931348623157E+308

    The most commonly-used primitive data types are the char, boolean, int, and double. The int is used usually instead

    of the byte, short, or long because it is a 32-bit integer and is the fastest primitive data type.

    A char represents Unicode characters, which include non-printable characters. Here are a few of the common non-

    printables:

    \t --- tab

    --- newline (In Windows, equivalent to hitting the 'Enter' key)

    \s --- white space

    \r --- carriage return

    A char can also represent other characters that are used to program in Java. You must precede these with a back

    slash so that Java knows they are control characters and not part of the program:

    \\ --- back slash

    \" --- double quote

    \' --- single quote

    To declare a data type in Java, you must specify the type itself and the name. Declarations do not include assigning a

    value to the type. Here are declarations for the eight primitive data types:

    boolean bResultValue;

    char cInitialLetter;

    byte yInitialValue;

    short xInitialValue;

    int iInitialValue;

    long lInitialValue;

    float fInitialValue;

    double dInitialValue;

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    8/17

    The initial lower-cased letter at the front of the data type names is a form of Hungarian Notation. This notation makes

    maintainability of the code much easier because you can identify what type of data the variable holds even when the

    variable name is used far away from the declaration. These lower-cased letters are suggestions, though the boolean,

    char, int, float and double letters are commonly-used. As usual in Java, you should initially capitalize any word in a

    variable name; in this case, any word that follows the initial lower-case notation letter.

    To initialize a primitive data type, you must assign a value to it. Here are initializations of the previous declared data

    types:

    bResultValue = true;

    cInitialLetter = 'A';

    yInitialValue = 3;

    xInitialValue = 15;

    iInitialValue = 255555555;

    lInitialValue = -123412578097;

    fInitialValue = 2343.1;

    dInitialValue = 12341541515.125;

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    9/17

    Numerical DataDATA TYPES :

    1.) CONSTANT are value which are fixed on a particular program run.

    2 Types of CONSTANT:

    1.) String Constant a set of characters enclosed in quotation mark.

    Example: "MELJUN", "Butuan City"

    2.) Numeric Constant is an integer or real number or decimal numbers.

    Example: 3.141516, 15, 12.0, 175,158

    2.) VariablesWhen a declaration, such as

    int x, y;

    is made, memory locations to store data values for x and y are allocated.

    These memory locations are called variables, and x and y are the names

    we associate with the memory locations.

    VARIABLES are unique symbols that identify a memory location in RAM.- are symbols that can hold number or other types of data.

    2 Types of VARIABLES :2.) String Variables a set of characters enclosed in quotation mark.

    Example: text = "MELJUN"; A = "Butuan City"

    2.) Numeric Variables is an integer or real number or decimal numbers.

    Example: pi=3.141516; x = 15; y = 12.0, Q = 175,158

    VARIABLESA variable has three properties:

    A memory location to store the value.

    The type of data stored in the memory location.

    The name used to refer to the memory location.

    Coverage for PRELIM EXAM

    Study & memorize this noteFACTSHEET in IT 102 COMPUTER PROGRAMMING 1

    MELJUN P. CORTES, MBA,MPA

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    10/17

    VARIABLESThe syntax for declaring variables is

    ;

    where is a sequence of identifiers separated by commas.

    Every variable we use in a program must be declared

    There are 6 numerical Data Types in Java: byte short int long float double

    byte, short, int, and long are for integers.----------------------- no decimal

    float and double are for real numbers---------------------------- w/ decimal

    VARIABLESAt the time a variable is declared, it can also be initialized.

    int count = 10, height = 34;

    We assign a value to a variable by using an A s s ignm ent S t a t em ent .Do not confuse mathematical equality and assignment. The following is not valid Java code:

    4 + 5 = x; ------- is not valid

    Total = Total + 1; ---is valid

    VARIABLESNumerical data are called pr imi t i ve data types

    EXPRESSIONSKinds of Expressions:

    1.) Mathematical Expressions used to produce numericresults.

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    11/17

    2.) Relational Expressions used to compare data value of thesame types.3.) Logical Expressions compare values of the same types toproduce a logical true or false, yes or no, 0 or 1.

    Logical Operators:1.) AND (&&) is a binary operator; both the left and right side expressionsmust be

    True for the whole expression to be true.

    2.) OR ( | | ) is a binary operator; if either the left or the right expression istrue, the

    Whole expression is true.

    3.) NOT ( !) is a unary operator; if the expressions to be evaluated is false, thenthe

    whole expressions is true.Arithmetic ExpressionsArithmetic operators in Java

    Arithmetic ExpressionsPrecedence rules for arithmetic operators and

    parentheses

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    12/17

    Arithmetic Expressions Rules for arithmetic promotion

    What are operators?Operators are symbols that take action within a program.

    Assignment operator (=) assigns a value to a field or variable:

    averageSpeed = 21.6;

    Mathematical operators include:

    +, -, *, and /

    Relational operators include:

    , ==, and !=

    Self-Assignment OperatorManipulates a variable and assigns the results back to itself.

    Self-assignment operators include +=, -=, *=, and %=

    int x = 5;

    int y = 6;

    x += y;

    x has the value (5 + 6) = 11

    Rules of Precedence (Order in solving a mathematical formula orequation)

    Java follows mathematical rules of precedence. Multiplication and division are handled first, followed by addition and

    subtraction

    Use parentheses to force evaluation

    Increment and Decrement Operators The increment operator (++) means increment (add) by one.

    ++x; The decrement operator (--) means decrement (subtract) by one.

    - -x;Prefix vs. Postfix

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    13/17

    Prefix notation increments, then fetches:

    int x = 5; int y = ++x; Value of y is 6 (1 + 5), value of x is 6

    Postfix notation fetches, then increments:

    int x = 5; int y = x++; Value of y is 5, value of x is 6

    What is a constant?A constant is a variable with a fixed value (cannot be changed). Use the keyword final to designate a constant.

    Constant identifiers are typically UPPER_CASE notation to distinguish them

    from other variables.

    Relational OperatorsEvaluate the equality or inequality of two intrinsic types.

    Return a boolean value (true or false)

    Equality: ==

    Inequality: , =, != (not equal)

    HIERARCHY of OPERATORS:1.) Group Expression mathematical equation/formula that are enclosed in parenthesis.

    2.) Exponentiation

    3.) Multiplication/Division are always solved from left to right.

    4.) Addition/Subtraction are always solved from left to right.5.) NOT

    6.) AND

    7.) OR

    Accumulator is a data storage/variable that is considered as expressions or mathematical expression

    for obtaining intermediate totals for a series of addition.- ACCUMULATE meaning that "ADDED".

    Example: Total_amount = Total_amount + amount

    Counter is a data storage for counting.

    - incremented by a CONSTANT. Example: CTR = CTR + 1

    HOW TO SOLVE THE MATHEMATICAL EXPRESSION/EQUATION:

    (Follow the RULES OF PRECEDENCE or Order/Hierarchy of operator)

    Example#1:

    A + B C * ( 2 * ( D E * F ) / 2 ) * G

    A + B C * ( 2 * I / 2 ) * G Quiz: Solve the following arithmetic expressions:

    1.) 12 + 7 * 3 = ?A + B C * ( 2 * I / 2 ) * G 2.) (12 + 7) * 3 = ?

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    14/17

    3.) (10 - 4) / 2 = ?

    A + B C * ( J / 2 0 * G 4.) 10 4 * 3 + 12 / 2 = ?

    5.) 20 5 * 3 + (5 * (120 4 * 2) * 6) / 5 = ?

    A + B C * K * G

    Quiz: Translate the following narrative into a

    A + B L * G valid arithmetic expressions:

    A + B M 1.) Let be Q1, Q2, Q3, Q4 be the scores in 4 quizzes

    Compute the average and store the variable,

    N M which is the result in AVE.

    Answer is O 2.) Let HW = be the number of hours worked.

    Compute the overtime pay(OTPAY) by

    multiplying the overtime rate (OTR) by

    the excess of 40 hours.

    3.) From the result in number#2 add the regular

    pay (RPAY) to the OVERTIME PAY(OTPAY) to

    give you the BASIC PAY (BPAY).Where:

    RPAY = 40 times rate per hour(RPH)

    BPAY = OTPAY + 40 * (RPH)

    Program Structure

    1.) Sequence

    2.) Selection

    3.) Repetition/Iteration

    Sequence -- consists of one or more instructions which are to be executed in sequence, one afteranother.

    --- is shown by one or more processes, predefined processes, & input/output symbolsjoined by flow lines. There is only one path of logic, from top to bottom. There is no

    branching of flow lines.

    Repetition -- allows for the repetition or iteration of some set instructions repeatedly until acondition tests out true.

    Selection---- allows for a choice between two paths of logic.--- it is also called an if-then-else structure or a decision structure.

    --- begins with a single represent a test. Based on the result of the test, either the logic pathon the left is taken. Both logic paths come back together at the bottom of the structure

    and a single flow line exists the structure.

    CODING is the process of translating the logic design into programming language code.

    TESTING is the process of converting the program into machine language.

    DEBUGGING is the process of locating and removing program ERRORS in the program.

    4 PHASES of Development Process:

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    15/17

    1.) Analysis

    2.) Design

    3.) Coding

    4.) Testing

    Algorithm DesignsControl Structures

    There are 3 types of control structures:

    Sequence

    Selection

    Repetition

    Sequence

    SelectionEx.

    RepetitionEx.

    ********************************

    3 Program Design Techniques:

    1.) Structured Programming

    2.) Top-down Design

    3.) Modularized Design

    PseudocodeBEGINGet 2 numbers

    Store in num1 & num2Calculate sum (num1 + num2(

    Output sumEND

    PseudocodeIF the telephone rings THEN

    Answer the phoneELSE

    Continue readingENDIF

    Pseudocode

    WHILE there is pressure on the matSoundthe bellENDWHILE

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    16/17

    C++ INTERPRETER|

    |-- read through source code andtranslate a program, turning the programmer's code - is your program that encode--SOURCE CODE

    or program instructions, directly into actions.

    C++ COMPILER|

    |- translate SOURCE CODE into an EXECUTABLE program that can be run at a later time.

    C++ LINKER|

    | is to tie together your compiled code with the libraries supplied by your COMPILER. lets you build your program in "pieces" and then link together the pieces into one big program.

    INTEGER VARIABLES are whole numbers;

    FLOATING-POINT VARIABLES are "real number" and have a "floating" DECIMAL point.

    - can be represented using a Mantissa & Exponent.

    PROBLEM SOLVING:

    1.) Given the following information:

    Variable to be used in Flowchart:

    a.) employee name ENAME

    b.) hours worked HWc.) rate per hour RPH

    d.) cola COLA

    e.) deduction DED

    Compute the Basic Pay:

    If hours worked

  • 8/9/2019 MELJUN CORTES 's - Algorithm Flow Charting Handouts

    17/17