Definitions

1.                  __________________ - Non-object types.

2.                  __________________ - A flag that will stop program execution during debugging.

3.                  __________________ - Calling a method defined within the class from a constructor or method defined within the same class.

4.                  __________________  - (%): used to obtain the remainder of division.

5.                  __________________  - Dividing an object into well-defined components.

6.                  __________________ - The name of the object used in an internal method. Needed when a name is overloaded (same name used simultaneously in different ways).

7.                  __________________ - Calling a method defined within a different class. The dotted object is used.

8.                  __________________  - Define Boolean operations.

9.                  __________________  - Executing a single statement.

10.              __________________ - Ignores details of object implementation, concerned only with object use.

11.              __________________  - Shows the objects and dynamic relationships between them.

12.              __________________ - Tool for examining a program state (variables and field values) and statements as it executes.

13.              __________________ - When more than one constructor (or method) has the same name.

14.              __________________  - Operate on Boolean (true or false) to produce a Boolean result.

15.              __________________  - Shows the classes and static relationships between them.

16.              __________________  - ( / ): used to obtain the quotient of division.

 

Abstraction                  Division operator                     Truth tables                 Logic operators

Modularization             Overloading                             Single Stepping           Breakpoint

Class diagram            Internal method call                this                              Primitive type

Object diagram           External Method call                Modulo operator          Debugger

                         

 

Identify the type of method call for each of the following:

  1. updateDisplay();                                 External                 Internal                 
  2. hours.setValue(hour);                         External                 Internal
  3. minutes.setValue(minute);                  External                 Internal
  4. MyString.length();                              External                 Internal
  5. Name at least 5 common abstractions found in every-day life.
    1. ____________________
    2. ____________________
    3. ____________________
    4. ____________________
    5. ____________________
  6. What is advantageous about software abstraction? ______________________________________________________________________.
  7.  Draw a static class diagram for the following in the space provided:

public class NumberDisplay
 {

         private int limit;
         private int value;

 

        Constructor and methods omitted

}

 

 

 public class ClockDisplay
 {

         private NumberDisplay hours;
         private NumberDisplay minutes;

 

         Constructor and methods omitted

}

 

 

 

 

  1. Explain what a dynamic Object diagram is. ____________________________________________________________________________________________________________________________________________
  2.  List all the primitive types you know.
    1. ______________________
    2. ______________________
    3. ______________________
    4. ______________________
  3. Determine the result:
    1. True || False                __________
    2. True && False             __________
    3. False && False           __________
    4. True && True              __________
    5. 13 % 6 =                      __________
    6. 18 % 2 =                      __________
    7. 32 % 7 =                      __________
  4. For n=0, 1, 2, 3, 4, 5, 6, ... What are all the possible results of:
    1. n % 4               ________________
    2. n % 2               ________________
  5. What two things can be different about an overloaded method signature?
    1. _______________________              b. _______________________
  6. When and why is a debugger used?

____________________________________________________________________.


 

                                          WS3 – Answers

  1. Primitive type
  2. Breakpoint
  3. Internal method call
  4. Modulo operator
  5. Modularization
  6. this
  7. External method call
  8. Truth tables
  9. Single stepping
  10. Abstraction
  11. Object diagram
  12. Debugger
  13. Overloading
  14. Logic operators
  15. Class diagram
  16. Division operator
  17. Internal
  18. External
  19. External
  20. External
  21. Answers will vary, some examples are:
    1. Refrigerator
    2. Car
    3. Television
    4. Microwave
    5. Washing Machine
  22. We can use methods (such as .length() ) which will return the desired result without knowing the details of how the method works.

 

  1.  

    Number Display

     

     

    Clock Display

     
     

 

 

 

 

 

  1. Visually depicts objects and dynamic relationships between them.
  2.  Answers may vary.
    1. int
    2. Boolean
    3. char
    4. String
  3.  
    1. True
    2. False
    3. False
    4. True
    5. 1
    6. 0
    7. 4
  4.  
    1. < 4
    2. < 2

 

  1. The return type and the parameters.
  2. To check field and variable values during execution. (To verify that the program is working correctly as well as locate errors.)