Download presentation
Presentation is loading. Please wait.
1
Take out a piece of paper and PEN.
Exposure Java 2015 for Teaching AP® Computer Science DYRT Quiz Take out a piece of paper and PEN. The quiz starts TWO minutes after the tardy bell rings. You will have 30 seconds per question.
2
Title the quiz as shown below The quiz starts in ONE minute.
Name Period Date Quiz 1. 11. 2. 12. 3. 13. 4. 14. 5. 15. 6. 16. 7. 17. 8. 18. 9. 19.
3
Question 01 double number = 6.25; double result = Math.sqrt(number);
What type of parameter is number in this program segment? double number = 6.25; double result = Math.sqrt(number); actual parameter formal parameter class parameter receiving parameter
4
Question 02 public static void sum(int n1, int n2)
What type of parameters are n1 and n2 ? public static void sum(int n1, int n2) actual parameters formal parameters class parameters receiving parameters
5
Question 03 Return methods always calculate some mathematical formula.
display a value. return a value. use numerical values.
6
Question 04 What type of method is written below?
public static void add(int n1, int n2) { System.out.println(n1 + n2); } return method add method void method print method
7
Question 05 What type of method is written below?
public static int add(int n1, int n2) { return n1 + n2; } return method add method void method print method
8
Question 06 What type of method is the main method? return method
add method void method print method
9
Question 07 Java’s Math class contains __________ methods. void class
void object return class return object
10
Question 08 Java’s Graphics class contains __________ methods. class
math object String
11
Question 09 Which of the following is wrong with the first stage
of the Payroll Case Study? There is no readable program format. The variable identifiers make no sense. All the program statements are in one module. All of the above
12
Question 10 The first stage, and very poorly written, Payroll
Case Study program does not compile. compiles, but executes incorrectly. compiles and executes. cannot be improved.
13
Question 11 Which of the following is an example of a
good self-commenting identifier? qwerty k netPay public
14
Question 12 Which of the following is/are true about designing a program? Use self-commenting identifiers. Use consistent indentation style. Don't place many program statements in the main method. Specific tasks should be placed in modules called methods. Similar methods accessing the same data should be placed in their own class. All of the above
15
Question 13 What kind of variable is x? local variable class variable
public class Quiz7613 { static String z = "Bob"; public static void main(String args[]) int x = 7; } public static void qwerty() char y = '?'; Question 13 What kind of variable is x? local variable class variable final variable
16
Question 14 What kind of variable is y? local variable class variable
public class Quiz7614 { static String z = "Bob"; public static void main(String args[]) int x = 7; } public static void qwerty() char y = '?'; Question 14 What kind of variable is y? local variable class variable final variable
17
Question 15 What kind of variable is z? local variable class variable
public class Quiz7615 { static String z = "Bob"; public static void main(String args[]) int x = 7; } public static void qwerty() char y = '?'; Question 15 What kind of variable is z? local variable class variable final variable
18
Question 16 Where can the variable x be used? the main method
public class Quiz7616 { static String z = "Bob"; public static void main(String args[]) int x = 7; } public static void qwerty() char y = '?'; Question 16 Where can the variable x be used? the main method the qwerty method entire Quiz7612 class
19
Question 17 Where can the variable y be used? the main method
public class Quiz7617 { static String z; public static void main(String args[]) int x = 7; } public static void qwerty() char y = '?'; Question 17 Where can the variable y be used? the main method the qwerty method entire Quiz7612 class
20
Question 18 Where can the variable z be used? the main method
public class Quiz7618 { static String z; public static void main(String args[]) int x = 7; } public static void qwerty() char y = '?'; Question 18 Where can the variable z be used? the main method the qwerty method entire Quiz7612 class
21
Question 19 When a program has multiple classes, which one is
called the Driving Class? The class with the same name as the file. The class with the most methods. The class with the least number of methods. The class with the main method.
22
Question 20 Which of these is a synonym for Class Variable? attribute
final variable local variable parameter
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.