16 questions
What would the output be for the following program if the user enters 4 and 6?
10
14
16
error
If the user inputs "Connolly"into surname and "Luke" into first what would be output?
Error
Connolly Luke
Luke Connolly
Connolly Luke Connolly Luke
John wants to create a subroutine in python that will roll a dice. Which is the correct method below?
DEFINE diceroll:INTEGER
def diceroll[]:
def diceroll():
def diceroll:
Norah wants to print her multiplication equation of 12 x 12. What code should she add below?
print (multiply)
a = 12
b = 12
answer = a * b
print(multiply(12, 12))
print(multiply(12 * 12))
"Declaration" refers to...
Storing data in variables
Creating variables
Repeating sections of code
Checking a condition to see which piece of code to run next
"Iteration" refers to...
Storing data in variables
Creating variables
Repeating sections of code
Checking a condition to see which piece of code to run next
A loop within a loop is...
Definite iteration
Indefinite iteration
Nested iteration
Reverse Polish iteration
Using "meaningful identifiers" means...
Giving variables and subroutines sensible names
Giving variables the correct data type
Correct use of conditions in loops
What is the term for a named block of code that can be executed by writing its name.
Subroutine
Condition
Selection
Some subroutines produce a result that is sent back to where they were called from. What is this value called?
Return value
Final value
Parameter
Variable
Local variables...
...only exist while their subroutine is executing
...are only accessible in the subroutine in which they are declared
...can only be of the 'integer' data type
...can be used from anywhere in a program
Which of the following is not an example of a subroutine?
Procedure
Function
List
Subroutines are designed to save the programmer time
True
False
Which subroutine will return a value back to the program?
Procedure
Function
Which subroutine will not return a value back to the program?
Procedure
Function
What are the parameters with in this procedure?
first name and second name
first and surname
first and second name
myname, first and surname