Mark

Mark

COMP560 W5 ZyCh8_Dictionaires

1) A set is a container that stores a collection of:A) unique values2) One key difference between a set and a list is:A) Set elements are not stored in any particular order3) Which statement correctly creates a set named colors that contains…

COMP560 W4 ZyCh9_Objects

1) Which of the following is considered by the text to be the most important consideration when designing a class?A) Each class should represent a single concept or object from the problem domain. 2) Which of the following questions should…

COMP560 W4 ZyCh11_Recursion

1) Consider the triangleArea function from the textbook shown below: Where is/are the recursive call(s)?A) line #7 2) Consider the triangleArea function from the textbook shown below: Where is/are the terminating condition(s)?A) lines #3 and #53) Consider the following code snippet for recursive addition:…

COMP560 W3 ZyCh5_functions

1) A ___________________________ is a sequence of instructions with a name. A) function 2) Consider the following function call round(3.14159, 3) what is the return value?A) 3.141 3) Consider the following function call ceil(3.14159) what is the return value?A) 4.0 4) Which of the…

COMP560 W3 ZyCh6_lists

1) What is a list in Python?A) a container that stores a collection of elements that are arranged in a linear or sequential order 2) Given the following list, what value is at index 5? A) 6 3) Consider the following line…

COMP560 W2 ZyCh2_NumberString

1) To store a value for later use in Python, the programmer needs to create a:A) variable2) How is a value stored in a variable?A) an assignment statement3) What is the value of the variable num after the following code snippet? A)…

COMP560 W2 Zych4_loops

1) How many times will the following loop run? i = 0 while i < 10 :    print(i)    i = i + 1 A) 10 2) How many times does the code snippet given below display “Loop Execution”?…

COMP560 Final Quiz

1) What is printed by the following code snippet? A) The answers are: 10 11 2) Although the following code statement is valid, print(10/0), what will happen when this code is executed?A) The error message ZeroDivisionError: int division or modulo by zero is…

COMP560 Zylabs W2

2.8.1: Calculate the length of this string literal. 2.8.2: Test your understanding of strings. 2.8.3: Test your understanding of concatenation. 2.8.4: Determine the result from each of the following string operations. 2.8.5: What is printed by the following code segment? 2.8.6: Test your understanding of converting…

COMP560 Zylabs W1

1.1.1: What is computer equipment called? 1.1.2: What does it take to write a complex program? 1.2.1: What part of the computer executes instructions? 1.2.2: What type of storage persists without electricity? 1.4.1: What consists of a large number of simple CPU instructions? 1.4.2: Determine what…