
Pro-chpt 9
Authored by Kerrishma Williams
Information Technology (IT)
University
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following must every method have?
a parameter list
a header
a return value
an empty parameter list
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A method’s interface includes its _______________.
parameter list and return type
identifier and parameter list
return type, identifier, and parameter list
parameter list
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A program contains a method with the header num calculateTaxes(num amount, string name). Which of the following methods can coexist in the same program with no possible ambiguity?
string calculateTaxes(num money, string taxpayer)
void calculateTaxes(num gross, string ssn)
num calculateTaxes(num annualPay, string taxpayerId)
num calculateTaxes(string name, num amount)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When you write the declaration for a method that can receive a parameter, which of the following must be included in the method declaration?
the name of the argument that will be used to call the method
the name of the method that will call the method
a local name for the parameter
a return type that is the same as the parameter type
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The value used in a method’s return statement must _______________.
match the data type of at least one of the parameters
be a variable
match the data type used before the method name in the header
be numeric
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When an array is passed to a method, it is _______________.
passed by reference
unnamed in the method
unalterable in the method
passed by value
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assume that you have written a method with the header void myMethod(num a, string b). Which of the following is a correct method call?
myMethod("Goodbye")
myMethod(12)
myMethod("Hola", 12)
myMethod(12, "Hello")
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?