Problem programs for Javascripts - PowerPoint PPT Presentation

1 / 3
About This Presentation
Title:

Problem programs for Javascripts

Description:

Write, test and debug XHTML files that include JavaScripts for the following problems. ... Output: The words of the input text, in alphabetical order. ... – PowerPoint PPT presentation

Number of Views:230
Avg rating:3.0/5.0
Slides: 4
Provided by: steveb9
Category:

less

Transcript and Presenter's Notes

Title: Problem programs for Javascripts


1
Problem programs for Javascripts
  • Chapter 4 Programming the WWW

2
Write, test and debug XHTML files that include
JavaScripts for the following problems.
  • Output A table of the numbers from 5 to 15 and
    their squres and cubes, using alert.
  • Output The first 20 Fibonacci numbers, which are
    defined as in the following sequence 1,1,2,3,
    Use document.write to produce the output.
  • Input Three numbers using prompt to get each,
    Output The largest of the three input numbers,
    Hint Use the predefined function Math.max
  • Modify the script of exercise 2 to input a number
    n, using prompt, which is the number of Fibonacci
    number required as output.

3
Problems contd
  • 5. Input A text string, using prompt.
  • Output Either Legal name or Illegal name,
    depending on whether the input names fit the
    required format, which is Last name, first
    name, middle initial where neither of the names
    can have more than 15 chars
  • 6. Input A line of text, using prompt
  • Output The words of the input text, in
    alphabetical order.
  • 7. Modify the script for exercise 6 to get a
    second input from the user, which is either
    ascending or descending. Use this input to
    determine how to sort the input words.
  • 8. Function no_zeros
  • Parameter An array of numbers
  • Result The given array must be modified to
    remove all zero values
  • Returns true if the given array included zero
    values false otherwise
Write a Comment
User Comments (0)
About PowerShow.com