Lect9DesignLoops - Announcements Instructor: Nelson...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Announcements Instructor: Nelson Padua-Perez (nelson@cs.umd.edu) Class Web Site: http://www.cs.umd.edu/class/fall2010/cmsc122/ No posting of code in the forum Check class announcements daily 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Designing Using Pseudocode So far we have focused on the syntax and semantics of JavaScript As the complexity of problems increase you need a design strategy to solve such problems Several alternatives exist to come up with a solution to a problem. A popular one is Pseudocode Pseudocode: English-like description of the set of steps required to solve a problem When you write pseudocode you focus on determining the steps necessary to solve a problem without worrying about programming language syntax issues
Background image of page 2
3 Pseudocode Example Pseudocode for finding the minimum value 1. Read number of values to process (call this value n) 2. Repeat the following steps until the n input values have been processed a. Read next value into x b. If (x is the first value read) { currentMinimum = x } else { if (x < currentMinimum) currentMinimum = x } 3. Print currentMinimum value
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

Lect9DesignLoops - Announcements Instructor: Nelson...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online