Assignment 4

Name:

Homework - Lesson 1.7

Due 9/4/2014

Circle the appropriate answer.

1.   An algorithm can be defined as follows:
a) Java method with a minimum of 2 statements
b) pre-defined steps to solve a problem
c) both of the above
d) none of the above


2.    Procedural decomposition helps with:
a) removing duplicate code by creating methods
b) breaking down of complex problems into smaller steps
c) both of the above
d) none of the above


3.    Methods:
a) are a group of statements that accomplish a task
b) are a group of statements with a name
c) both of the above
d) none of the above


4.    Given the following two static methods X and Y, write a complete main method to print BABABB
       using only calls to X and Y. (Do not call System.out.print directly.)

public static void X() {
System.out.print(“AB”);
}

public static void Y() {
System.out.print(“B”);
}

No comments:

Post a Comment