Homework 7 - Virtual Pest (part 3)

by JLPopyack & Paul Zoski

Due Date: Monday, December 2 at Midnight
Late Due Date: Wednesday, December 4 at Noon


PURPOSE:

This is the final part of a three-part assignment. The requirements for the first part were for you to design a virtual pest and its behavior. The requirements for the second part were for you to implement the user interface and design the structure for the software that implements the behavior. The final part is to add the described behavior using JavaScript functions and statements.


THE ASSIGNMENT:

This assignment consists of three sections:

  1. Suggested problems (not to be turned in) from the text.
  2. Written problems to be turned in.
  3. A design project (Virtual Pests).
Click here to return to top of this page..

  1. Suggested Problems (from the Decker & Hirshfield text):

    From the Analytical Engine text: Module 5.9, pp. 198-199, problems 9, 12, 19
    Module 9.6, p324, problem 3, 4, 6 (very important), 8

  2. Click here to return to top of this page.


  3. Problems to be turned in:
    From the Analytical Engine text: Module 5.9, pp. 198-199, problems 10

    1. (10 points) For each of the following loops, supply the missing piece of code so that 12 *'s will be printed on the web page. (Submit the entire code, not just the missing piece of code).

      1. for( var index = 1; index <= _________________ ; index ++ )
        
          document.write("*")
      2. for( var index = _________________ ; index <= 30 ; index ++ )
        
          document.write("*")
      3. for( var index = 30; index >= _________________ ; index -= 2 )
        
          document.write("*")
    2. (10 points) Write a JavaScript function StarBar(number) that will print number *'s on a web page. For example StarBar(6) will print
      ******
      and StarBar(9) will print
      *********
      (including an line break). (You may wish to write a test page for you function before submitting it).

    Click here to return to top of this page.


  4. Virtual Pests, part 3:

    Using the table of behaviors you specified in Parts I-II as a guide, complete your virtual pest by translating these to the appropriate JavaScript commands and testing them for correctness.

    Also upload your completed pest to your course website and supply the URL (on your gradesheet).

    DETAILS:

    As discussed in class, you need to link your form elements to functions so that the values of the form elements may be transferred to the function for processing, then back to the form for display purposes. See the class lecture notes on Forms and Functions for more details on accomplishing that.

    A sample virtual pest based on the example in Parts I-II has been provided for your assistance in this regard. Several points are worthy of note:

    You should upload your virtual pest to your website and provide its URL on your gradesheet.

  5. Click here to return to top of this page.


  6. Extra Credit

    Students are encouraged to have fun with their pests. You may add any features you desire, such as sound or animation. Be creative. You might get points for it.

  7. Click here to return to top of this page.


WHAT TO TURN IN:

All work is to be submitted electronically via WebCT. It is suggested you complete your work early so that a TA can help you if you have difficulty with this process.

Click here to return to top of this page.

ACADEMIC HONESTY:

You must compose all written material yourself, including answers to book questions. All material taken from outside sources must be appropriately cited. If you need assistance with this aspect of the assignment, see a consultant during consulting hours.

Click here to return to top of this page.