Introductory Mobile Application Development

Case 2: Functions

Think-Design-Write Test-Code

5 days

  • Description

Following up on your assignment to learn JavaScript, and having mastered variables and operations, you now decide to move on to mastering one of the other basic components of most programming languages, functions.

You decide to modify the work you did while learning about variables and create functions that will add, subtract, multiply, and divide two numbers as well as another one that concatenates two strings.

  • Deliverables
    1. A test matrix that shows inputs and the expected output for those inputs.
    2. Working code that assigns two variables and displays the sum, difference, product, and quotient of the two variables and if the result of calling the function is greater, less than, or equal to 15.  The values passed in as parameters must be changed, the functions exercised again, and the results of the new calculations displayed.
    3. Working code, as a function,  that concatenates three hard-coded strings and displays the resultant string.
  • Resources
    1. Functions tutorial
    2. Definitions:
      • Function – a grouping of computational statements that are usually used repeatedly. Functions can have zero or many parameters.
      • Parameter – a value passed into a function. These parameters can be acted on inside the function or direct the function how to act.

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.