Presentation is loading. Please wait.

Presentation is loading. Please wait.

DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.

Similar presentations


Presentation on theme: "DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING."— Presentation transcript:

1 DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING

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

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

5 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. Programming Language

6 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. Programming Language

7

8 Top Programming Language Rank http://codeeval.com

9 History of Programming

10

11

12

13

14

15

16 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. 14/08/14

17 Steps in Program Development 1.Define the problem 2.Outline the solution 3.Develop the outline into an algorithm 4.Test the algorithm for correctness 5.Code the algorithm into a specific programming language 6.Run the program on the computer 7.Document and maintain the program

18 Steps 1: Define the Problem This steps involves carefully reading and rereading the problem until you understand completely what is required The problem should be divided into three (3) separate components: –The inputs –The outputs –The processing steps to produce the required output

19 Steps 2: Outline the Solution Once the problem defined, you may decide to break it down into smaller tasks or steps, and establish a solution outline –The major processing steps involved –The major subtasks (if any) –The user interface (if any) –The major control structures (e.g. repetition loop) –The major variables and record structure –The mainline logic

20 Steps 3: Outline into Algorithm The solution outline developed in Steps 2 is then expanded into an algorithm: a set of precise steps that describe exactly the tasks to be performed and the order in which they are to be carried out

21 Steps 4: Test the Algorithm The main purpose of desk checking the algorithm is to identify major logic errors early, so that they may be easily corrected Test data needs to be walked through each step in the algorithm to check that the instructions described in the algorithm will actually do what they are supposed to

22 Steps 5: Code the Algorithm Only after all design considerations in the previous four steps have been met should you actually start to code the program into your chosen programming language.

23 Steps 6: Run the program This step uses a programmer compiler and programmer-designed test data to machine test the code for syntax errors This steps may need to be performed several times until you are satisfied that the program is running as required.

24 Steps 7: Document and maintain the program Documentation includes both external documentation (such as hierarchy charts, the solution algorithm and test data result) and internal documentation that may have been coded in the program. Program maintenance refers to changes that may need to be made to a program throughout its life.

25 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

26 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

27 Algorithm Example 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

28 14/08/14


Download ppt "DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING."

Similar presentations


Ads by Google