Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Like this presentation? Why not share!

- MCQ's for class 7th by Asad Shafat 47051 views
- Final examination 2011 class vii by Asad Shafat 16567 views
- Mid term examination -2011 class vii by Asad Shafat 15134 views
- Math class 7 Chapter 5 by Tanvir Ahamed 148 views
- MCQ's for 6th class, Countdown by Asad Shafat 16354 views
- Papers for 8th class , Mcq's for 8t... by Asad Shafat 19727 views

6,701 views

Published on

PROG 1026 Logic and Problem-Solving: notes from Class 7, Notation, Flowcharts and Pseudocode

No Downloads

Total views

6,701

On SlideShare

0

From Embeds

0

Number of Embeds

14

Shares

0

Downloads

137

Comments

0

Likes

1

No embeds

No notes for slide

- 1. Class 7 – Intro to Notation, Flowcharts and Pseudocode
- 2. Agenda Process development Algorithmic approaches to problem-solving Pseudocode Algorithm Structure Flowcharting Application Project Development
- 3. What is a Process? Discuss: what is a process? What are some examples of processes you encounter in your day-to-day routine? How can you describe a process What are the important criterion and parameters of a process? Exercise 7-1: What is a Process?
- 4. Process Debrief What issues occurred in developing your process? What important considerations were necessary? What elements are common to the various processes described? What elements were unique?
- 5. Process as Problem-Solving ALGORITHMIC SOLUTIONS some problems such as baking a cake, or balancing a cheque book can be solved with a concise set of instructions or actions HEURISITIC SOLUTIONS some problems aren’t so straight forward and rely heavily on knowledge and experience; i.e. whether to expand a company; how to best buy stocks on the stock market, etc. heavily reliant on the process of trial and error and cannot be reached by a series of direct steps
- 6. Algorithmic Solutions An ALGORITHM is a set of precise steps that describe exactly the tasks to be performed, and the order in which they are to be carried out It can be defined in programming terms as a set of detailed, unambiguous and ordered instructions, developed to describe the processes necessary to produce the desired output from a given input Algorithms may be described in structured language or graphically
- 7. Algorithm Approaches IPO Input Processing Output Expanded IPO Includes Problem Statement Risk – certainty & uncertainty Approach Diagram Testing Options Pseudo-code – structured syntax
- 8. Pseudocode Pseudo-code is structured English that states the steps to the problem solution 1. Statements are written in simple English 2. Each instruction/step is written on a separate line 3. Keywords and indentation are used to signify particular control structures 4. Each set of instructions is written from top to bottom, with only one entry and one exit
- 9. Sample Pseudocode # Start Program # Prompt for Assignment Name # Get Assignment Name and assign to variable # Loop through Student 1-12 # prompt for grade # get grade and assign to variable # End Loop when 12 student grades are entered # Calculate Average and assign to variable # If the average is greater than 75% # msg is “Well Done” # Else # msg is “Oh, oh!” # End if # Compose the output string # Send the formatted output to the screen # End Program
- 10. Structure Theorem The theorem states that it is possible to write any computer program by using only three basic control structures These control structures are: Sequence (order of steps) Selection, or conditional (if-else-then) Repetition, or iteration (for-next)
- 11. IPO and Pseudocode
- 12. Practice Pseudocode Exercise 7-2 Code an algorithm using pseudocode using Ruby notation, and appropriate indentation Exercise 7-3 If time allows
- 13. Flowcharting A graphical representation of program logic using a series of geometric symbols and connecting lines Flowcharts are relatively easy to learn and are intuitive Help to identify flow of data Track variables through the life of the application
- 14. Flow Chart Notation Terminal symbol- indicates the starting or stopping point of logic: Input/Output symbol- reading or writing input/output: Process Symbol- any single process, such as assigning a value or performing a calculation: Decision Symbol- comparisons/ T or F decision: Flowlines- connect symbols in the flowchart: arrow head suggests flow of data a straight line may be used to indicate a relationship
- 15. Sample FlowChart Pseudocode Start Program Prompt for assignment Loop through grades Get student grade Increment counter End loop Calculate Average Print Average End Program start end Assignment name? Set counter = 1 Counter>10? Calculate Average Print Average Increment Counter Student Grade? Yes No
- 16. Flowchart Practice Develop Flowchart for the last pseudocode exercise Notes: Pseudocode often follows the development of a flowchart Some applications are developed to generate code or pseudocode based on a work flow or flow chart Application flowcharts are often very complex Please ensure future Ruby solutions are properly documented with pseudocode notation (# plus indentation)
- 17. Application Project Work Begin to develop your project flowchart and pseudocode
- 18. Summary Process Algorithm and structure Notation Pseudocode Flowchart Next steps Refine your notation for Project 1

No public clipboards found for this slide

×
### Save the most important slides with Clipping

Clipping is a handy way to collect and organize the most important slides from a presentation. You can keep your great finds in clipboards organized around topics.

Be the first to comment