Sample Questions - Final Quiz
CSc 420 - Programming Languages - Prof. Domanski - CSI/CUNY

JavaScript Questions

True or False and Fill-in's --

  1. JavaScript is a product of a joint venture between Microsoft and Sun
  2. Microsoft's Internet Explorer can execute JavaScript, but Netscape Navigator will not execute VBScript
  3. In the order of precedence for a script, addition is evaluated before multiplication
  4. You cannot mix JavaScript event handlers with HTML tag properties.
  5. The exclamation point is used to indicate HTML comments
  6. To change webpage background colors you use the _____ attribute in the <BODY> tag.
  7. The name of the function that will call a function after a specified amount of milliseconds is __________
  8. The function ________ is used to check whether the parameter passed to it is a valid integer or floating point number.
  9. Write the statements that would define a form named msgForm and define a text box called scrollingMsg of width 23 that would be on msgForm.
  10. _________________________________________________

    _________________________________________________

    _________________________________________________

  11. If you wanted to change the value of the string in the text box above to "Hi. What's New", the statement to do that is

_________________________________________________

 

Multiple Choice

  1. A variable must begin with a _____ or a ______
  1. Letter, number
  2. Letter, underscore
  3. Number, pound sign (#)
  4. Uppercase letter, number

 

  1. The reason that a _____ cannot be used in a variable name is that they are used to separate objects, properties and methods.
  1. Underscore
  2. Comma
  3. Period
  4. Slash

 

  1. You place JavaScript code in the _____ section(s) of a webpage.
  1. BODY
  2. HEAD and BODY
  3. HEAD
  4. TITLE

 

  1. Which of the following is not a data type for Javascript variables?
  1. Boolean
  2. Floating point
  3. String
  4. Numeric

 

  1. When using the substring() method to extract a string of data, you need to supply the relative position of the first character to be extracted and …
  1. The relative position of the last character
  2. The relative length of the characters extracted
  3. The relative position of the last character plus one
  4. The number of characters in the entire string

 

  1. Which event handler performs an action when a document is loaded?
  1. Onclick
  2. Onload
  3. Onmouseover
  4. Onfocus

 

 

J++ Questions

  1. What are the two Java packages that must be imported to provide support for a Java applet? __________________ and ____________________
  2.  

  3. If we're defining a class called MyApplet, complete the statement (below) that begins the definition --
  4. public class MyApplet ____________________

    {

  5. If we've written the Java code for MyApplet, complete the APPLET statement below that will start MyApplet when the webpage it's defined on starts.
  6. <APPLET width=320 height=200 _____________>

     

  7. Given private Label mouseLbl = new Label(); complete the init() definition so that mouseLbl is defined at the bottom of the applet display area.
  8. public void init()
    {
    super.init();
    ____________ (new BorderLayout());
    add (__________, mouseLbl);
    }

     

  9. If the following a valid thing to do?
  10. Button ok = new Button("OK");
    Public void init()
    {

    FlowLayout flowingButtons = new FlowLayout();
    SetLayout(flowingButtons);
    add(ok);

    }

  11. Which Layout Manager works by defining rows and columns? ___________
  12. If we define Panel flowPanel = new Panel(); What statement will cause the Layout Manager for this panel to be flowingButtons? ________________________
  13. What Layout Manager will allow us to add multiple panels to the layout being used? ___________________
  14. True or False: the following statement will display the flowPanel --
  15. flowPanel.display(true);

  16. True or False: is it possible to click on a button displayed and cause the panel displayed to change?

ALL LABS ARE DUE (VIA FTP ONLY) THE DAY OF THE FINAL - NO LABS WILL BE ACCEPTED LATE UNDER ANY CIRCUMSTANCES WHATSOEVER