Presentation is loading. Please wait.

Presentation is loading. Please wait.

Amalan Kejuruteraan Sem /2014

Similar presentations


Presentation on theme: "Amalan Kejuruteraan Sem /2014"— Presentation transcript:

1 Amalan Kejuruteraan Sem 3 2013/2014
Problem Solving Tool Amalan Kejuruteraan Sem /2014

2 Structure Chart/Hierarchy Chart
Structure Chart shows : the functional flow through your program. how you are going to break your program into logical steps, each step will be a separate module. the interaction between all the parts(modules) of your program.

3 Flooring cost Get UserInfo Calculate Cost Print Report Calc Linoleum
Calc Carpeting Calc Kitchen Calc Bathroom Calc Bedroom Calc Living Areas Structure chart for calculating square footage.

4 Pseudo code Precise algorithmic description of program logic
Its purpose is to describe, in precise algorithm detail, what the program being design is to do. Requires the defining the steps to accomplish the task in sufficient detail so that they can be converted into a computer program.

5 Pseudocode for Calculate Bathrooms
Algorithm Calculate Cost 1.0 prompt user and read linoleum price 2.0 prompt user and read number of bathrooms 3.0 set total bath area and baths processed to zero 4.0 while (bath processed < number of bathrooms) 4.1 prompt user and read bath length and width 4.2 total bath area = total bath area + bath length * bath width 4.3 add 1 to bath processed 5.0 end while 6.0 bath cost = total bath area * linoleum price 7.0 return bath cost End Algorithm calculate Bathrooms

6 Flowchart Uses standardized symbols to show the steps the computer needs to take to accomplish the programs goal.

7 Basic Symbols Represent
Various Operation Direction Preparation Terminal – beginning / end Process Decision Input / Output Connector Sub-function

8 Flowchart for the whole program
Start Get User Info Calculate Cost Print Report Start

9 Calculate Cost Read (linoPrice) Read (numBath) bthArea zero
bathProc zero 1

10 1 bathProc < numBath READ (bthLngth,bthWdth) bthArea bthArea +
linoCost RETURN No Yes bthArea * linoPrice

11 Decision Structure If student’s grade is greater than or equal to 60
Pseudocode If student’s grade is greater than or equal to 60 Print “Passed” Else Print “Failed”

12 Repetition Structure While product is less than or equal to 1000
Pseudocode While product is less than or equal to 1000 Multiply product by two


Download ppt "Amalan Kejuruteraan Sem /2014"

Similar presentations


Ads by Google