1 / 28

DCT 1123 PROBLEM SOLVING & ALGORITHMS

DCT 1123 PROBLEM SOLVING & ALGORITHMS. INTRODUCTION TO PROGRAMMING. Subtitle Here. COMPUTER PROGRAMMING CONCEPTS PROBLEM SOLVING OVERVIEW ALGORITHM OVERVIEW (PSEUDOCODE & FLOWCHART). CONTENTS. What is Computer Programming?.

selah
Download Presentation

DCT 1123 PROBLEM SOLVING & ALGORITHMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DCT 1123PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING

  2. Subtitle Here COMPUTER PROGRAMMING CONCEPTS PROBLEM SOLVING OVERVIEW ALGORITHM OVERVIEW (PSEUDOCODE & FLOWCHART) CONTENTS

  3. What is Computer Programming? • Writing software, computer programs, is describing how to do something. • It is a lot like writing down the steps it takes to do something - a process.  • So, writing a computer program can be like composing music, like building a house, like creating lots of stuff. 

  4. Programming Language • Just like we have many different languages in use throughout the world for us humans to communicate with, there are different languages that we use to communicate with a computer.  • Computer languages are used to tell the computer what to do, you instruct it. 

  5. Programming Language • We need a language to communicate with a computer. • Computer languages are used to tell the computer what to do, you instruct it.  • Once it is written, the programmer uses a compiler to turn it into a language that the computer can understand. • Most software written today is using high level language such as C++, JAVA and etc.

  6. Programming Language

  7. Top Programming Language Rank http://jacobian.web.id/2010/11/14/java-and-c-top-programming-language-rank/

  8. History of Programming

  9. History of Programming

  10. History of Programming

  11. History of Programming

  12. History of Programming

  13. History of Programming

  14. History of Programming

  15. What is Problem Solving ? • The process of working through details of a problem to reach a solution. • Problem solving may include mathematical or systematic operations and can be a gauge of an individual's critical thinking skills.

  16. Algorithm Overview • An algorithm is like a recipe; it lists the steps involved in accomplishing a task • In a programming, it is a set of detailed, unambiguous and ordered instructions developed to describe the processes necessary to produce desired output • Written in simple English

  17. Algorithm Overview • For example, if you want to instruct someone to add up a list of prices on a pocket calculator, you might write: • Turn on calculator • Clear calculator • Repeat the following instructions • Key in ringgit amount • Key in decimal point • Key in cents amount • Press addition (+) key • Until all prices have been entered • Write down total price • Turn off calculator

  18. Important Properties of Algorithms • Correct • always returns the desired output for all legal instances of the problem. • Unambiguous • Precise • Efficient • Can be measured in terms of • Time • Space • Time tends to be more important

  19. Pseudocode • Pseudocode & flowcharts are popular ways of representing algorithms • Easy to read & write and allows programmer to concentrate on the logic of the problem • Using structured English

  20. How to Write a Pseudocode • Statements are written in simple English • Each instruction is written on a separate line • Keyword & indentation are used to signify particular control structures • Each set of instructions is written from top to bottom, with only one entry and one exit • Groups of statements may be formed into modules, and that group given a name

  21. Flowchart • Flowchart is an alternative method of representing algorithms • It is popular because they graphically represent the program logic through series of standard geometric symbols and connecting lines

  22. Flowchart Symbols Terminal Symbol Indicates the starting or stopping point in the logic. Every flowchart should begin and end with a terminal symbol. Input / Output Symbol Represents an input or output process in an algorithm, such as reading input or writing output

  23. Flowchart Symbols Process Symbol Represents any single process in an algorithm, such as assigning a value or performing a calculation Predefined Process Symbol Represents an input or output process in an algorithm, such as reading input or writing output

  24. Flowchart Symbols Decision Symbol Represents a decision in the logic involving the comparison of two values. Alternative paths are followed, depending on whether the decision symbol is true or false Flowlines Connect various symbols in a flowchart, and contain an arrowhead only when the flow control is not from top to bottom or left to right

  25. Sample Pseudocode & Flowchart Input letter If letter is ‘M’ Display ‘Malaysian’ Else Display ‘Foreigner’ End

  26. REFERENCES • http://www.yourdictionary.com/programming • http://www.businessdictionary.com/definition/problem-solving.html • http://www.howstuffworks.com/c1.htm • http://visual.ly/history-programming-languages

More Related