Java
Data Types
OOP
Common Algorithms
Pseudocode
100

What modifier is given to methods in java that do not have a return value?

void

100

How many more bits are used to store a double than a float?

32

100

In order to create an instance of an object, every class requires this method.

Constructor method

100

Describe the time complexity of binary search using bigO notation

O(logn)

100

List four key words that you should definitely use in creating an algorithm in pseudocode. These words are often capitalized.

GIVEN, FOR, IF, ELSE, WHILE, END, RETURN, BREAK...

200

The array class is being used in a module. What should the very first line of code be?

*Correct syntax and spelling only

import java.util.*;

200

integer, character, float and double are all primitive data types. Give another example of a primitive data type.

boolean

also accept (short, long, byte etc..)

200

A programmer designs a class "Cat" and a class "CatFood". Use one word to describe the arrow drawn to demonstrate the relationship between the Cat and its CatFood.

Aggregation

Ex: 1 Cat has 1 CatFood

200

A certain method looks at elements in a collection of size n. The method contains a nested loop. What time complexity would you anticipate for this method?

O(n2)

200

Calculate the output for 

X = 10

Z = 2

Repeat (X mod 4) times:

     Z = X div Z

Output Z

2

300

Create code to replace the comment.

    String name = "Mr. Considine";

    String prefix = "";

    // set prefix equal to the correct substring of name

prefix = name.substring(0,3);

300

An array A has a collection of n names. Write java code that can access the second letter of the name in the middle of the array. Assume is an odd number.

char c = A[n/2].charAt(1);

300

What modifier is given to variables that necessitate encapsulation?

private

300

The traveling salesman problem is a classic problem that is not solvable with any efficient algorithm (Mr. C describes...)

What time complexity would be given to this problem for its "brute-force" solution?

O(2n)

300

Create pseudocode to sort an array A in descending order.

on the board...