Home | | Internet & World Wide Web HOW TO PROGRAM | | Internet Programming | | Web Programming | Algorithms - JavaScript(JS) Control Statements

Chapter: Internet & World Wide Web HOW TO PROGRAM - The Ajax Client - JavaScript: Control Statements I

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail

Algorithms - JavaScript(JS) Control Statements

Any computable problem can be solved by executing a series of actions in a specific order.

Algorithms

 

Any computable problem can be solved by executing a series of actions in a specific order. A procedure for solving a problem in terms of

 

1. the actions to be executed, and

 

2. the order in which the actions are to be executed

 

is called an algorithm. The following example demonstrates that correctly specifying the order in which the actions are to execute is important.

 

Consider the “rise-and-shine algorithm” followed by one junior executive for getting out of bed and going to work: (1) get out of bed, (2) take off pajamas, (3) take a shower, (4) get dressed, (5) eat breakfast, (6) carpool to work. This routine gets the executive to work well prepared to make critical decisions. Suppose, however, that the same steps are performed in a slightly different order: (1) get out of bed, (2) take off pajamas, (3) get dressed, (4) take a shower, (5) eat breakfast, (6) carpool to work. In this case, our junior executive shows up for work soaking wet. Specifying the order in which statements are to be executed in a computer program is called program control. In this chapter and Chapter 8, we investigate the program-control capabilities of JavaScript.

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail


Copyright © 2018-2020 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.