JavaScript - Control Statements 1

JavaScript - Control Statements 1 - Chapter 8 - JavaScript:...

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

View Full Document Right Arrow Icon
Chapter 8 - JavaScript: Control Statements I Outline 8.1 Introduction 8.2 Algorithms 8.3 Pseudocode 8.4 Control Structures 8.5 if Selection Statement 8.6 if…else Selection Statement 8.7 while Repetition Statement 8.8 Formulating Algorithms: Case Study 1 (Counter-Controlled Repetition) 8.9 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 2 (Sentinel-Controlled Repetition) 8.10 Formulating Algorithms with Top-Down, Stepwise Refinement: Case Study 3 (Nested Control Structures) 8.11 Assignment Operators 8.12 Increment and Decrement Operators 8.13 Note on Data Types 8.14 Web Resources
Background image of page 1

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

View Full DocumentRight Arrow Icon
Objectives In this lesson, you will learn: To understand basic problem-solving techniques. To be able to develop algorithms through the process of top-down, stepwise refinement. To be able to use the if and else selection statements to choose among alternative actions. To be able to use the while repetition statement to execute statements in a script repeatedly. To understand counter-controlled repetition and sentinel-controlled repetition. To be able to use the increment, decrement and assignment operators.
Background image of page 2
8.1 Introduction Writing a script Thorough understanding of problem Carefully planned approach Understand the types of building blocks that are available Employ proven program-construction principles
Background image of page 3

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

View Full DocumentRight Arrow Icon
8.2 Algorithms A procedure for solving a problem in terms of Actions to be executed Order in which the actions are to be executed
Background image of page 4
8.3 Pseudocode Artificial & Informal language Helps programmers develop algorithms
Background image of page 5

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

View Full DocumentRight Arrow Icon
8.4 Control Structures Sequential execution Statements execute in the order they are written Transfer of control Next statement to execute may not be the next one in sequence Three control structures Sequence structure Selection structure if else switch Repetition structure while do for in
Background image of page 6
8.4 Control Structures Flowchart Graphical representation of algorithm or portion of algorithm Flowlines Indicate the order the actions of the algorithm execute Rectangle symbol Indicate any type of action Oval symbol A complete algorithm Small circle symbol A portion of algorithm Diamond symbol Indicates a decision is to be made
Background image of page 7

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

View Full DocumentRight Arrow Icon
8.4 Control Structures add grade to total total = total + grade; add 1 to counter counter = counter +  1 ; Fig. 8.1 Flowcharting JavaScript’s sequence structure.
Background image of page 8
8.4 Control Structures JavaScript Keywords         break   case   catch   continue   default   delete   do   else   finally   for   function   if   in   instanceof   new   return   switch   this   throw   try   typeof   var   void   while   with   Keywords that are reserved but not currently used by JavaScript abstract   boolean   byte   char   class   const   debugger   double   enum   export   extends   final   float   goto   implements   import   int   interface   long   native   package  
Background image of page 9

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

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

Page1 / 37

JavaScript - Control Statements 1 - Chapter 8 - JavaScript:...

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

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