AP CSA 5.4 / 5.5 (Getters / Setters)

Quiz
•
Computers
•
10th - 12th Grade
•
Medium
Herman Galioulline
Used 18+ times
FREE Resource
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The return type for the isOlderThan5 method should be void.
The return type for the isOlderThan5 method should be String.
The return type for the isOlderThan5 method should be int.
The isOlderThan5 method is missing a return statement for the case when age is less than or equal to 5.
The isOlderThan5 method should receive the variable age as a parameter.
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The class is missing a mutator method.
The class is missing an accessor method.
The accessor method is missing a return type.
The accessor method returns a variable other than an instance variable.
The instance variables should be designated public instead of private.
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The getH method should have a double parameter.
The getH method should have an int parameter.
The getH method should return newH instead of h.
The getH method should have a return type of int.
The getH method should have a return type of void.
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
In line 10, the appendIt method should be declared as return type String.
Line 12 should be changed to str = s + str;.
Line 12 should be changed to str = str + s;.
Line 12 should be changed to return s + str;.
Line 12 should be changed to return str + s;.
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
In line 14, levelUp should be declared as type void.
In line 14, amount should be declared as type void.
Line 16 should be changed to strength + amount;.
Line 16 should be changed to return strength + amount;.
Line 16 should be changed to return amount;.
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
In lines 14 and 18, change < to >.
In lines 14 and 18, change < to <=.
In line 16, change score1 to num1 and in line 18, change score2 to num2.
In line 18, change else if to if.
In line 18, change else if to else.
Similar Resources on Wayground
10 questions
Programming Basics

Quiz
•
11th - 12th Grade
10 questions
Programming Paradigms

Quiz
•
12th Grade
10 questions
Java Inheritance Quiz

Quiz
•
11th Grade
10 questions
Mastering Text File Handling in Python

Quiz
•
12th Grade
10 questions
Vocabulary Do Now 1

Quiz
•
9th - 12th Grade
7 questions
Activity 2.1.3 Password Strength -- Strong!

Quiz
•
9th - 12th Grade
10 questions
Python. Пользовательские функции и процедуры. Рекурсия.

Quiz
•
10th Grade
10 questions
Single Page Processing

Quiz
•
11th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade