What are parameters?
A procedure that is defined by the user is called a
The value that a non-void method outputs is called
What is true of a void method?
What does this method call doubleNumber(7.8); return, given the following method?
14.0
What does the method call tripleString(“APCSA”); return for the following method?
What will the value of myBankAccount be after the method call depositMoney(myBankAccount, 572);?
122
What is returned by this method call: translator(“pokemon”)?
What will this method call print to the screen?
formatText(2018, 17, “Dec”)
What is wrong with this method definition?
Why do we use methods in Java?
I. To make code easier to understand
II. To define global variables
III. To avoid repeated code
IV. To simplify code
V. To avoid needing to define them as public or private
A coffee shop has created a DrinkOrder class. The class contains variables to represent the following:
An object latte has been declared as type DrinkOrder after someone has ordered a Latte.
Which of the following descriptions is accurate?
After the execution of the following lines of code, what will be output onto the console?
String letters = “ABCde”;
String name = “Karel the Dog”;
String letter = “D”;
System.out.println(name.indexOf(letter));
System.out.println(letters.indexOf(name.substring(3,4)));
System.out.println(letters.indexOf(letter));
10
4
-1
Consider the following class:
Assume that a Coin object quarter has been properly declared and initialized. Which of the following code snippets will successfully assign the value of quarter to a new variable coinWorth?
Consider the following class:
Which of the following is NOT a possible header for a new constructor for the Insect class?

Which of the following code segments would successfully square the minimum value between two int variables x, y?
Consider the following class:
public class Dog
{
private String name;
private String breed;
public String getName()
{
return name;
} }
An object Karel is created using the Dog class. What would the result of the command System.out.println(Karel.getName()); be?
Consider the following method:
The following code segment calls the method doubleVal:
What is printed when the code segment is executed?
13.0
Which of the following can be used to replace /*Code to be implemented */ so that the code segment produces a random number between 1-100?

Consider the following class:
What would the output be of the following code segment:
RandomCalculator calc = new RandomCalculator(4, 5);
System.out.println(calc.add(5.0));
System.out.println(calc.add(5.0, 5));
System.out.println(calc.add(5, 5.0));

5
9
11.0
Consider the following code segment:
What is printed as a result of executing the code segment?
Which of the following code segments would correctly assign word from the String sentence = “Grab the last word” to the variable lastWord?
I only
III only
I and II only
I and III only
I, II, & III
I and III only
Consider the following class:
What is the difference between a primitive type and a reference type?
