Test - Python Computer science

profileprity29137
cosc-1436-Finalreviewquestions.pdf

COSC 1436 Final Exam Review Exercises Q1: Which of the following is a relational operator?

A. = B. == C. and D. or

Q2: Which print statement displays the value of s without starting a new line? A. print(end="s") B. print(s) C. print("s") D. print(s, end="")

Q3: What is the output of the following code snippet?

i = 1 while i < 10 : print(i, end = " ") i = i + 2 if i == 5 : i = 9 A. 1 3 5 B. 1 3 9 C. 1 3 5 7 9 D. 1 3 5 9

Q4: What is the minimum number of bits needed to represent 16 things? A. 2 B. 3 C. 4 D. 8

Q5: What causes numeric overflow? A. using fixed-sized numbers in a floating-point calculation B. a calculation producing an invalid result C. a calculation producing a value that won't fit into the allotted space D. using a radix point instead of a decimal point E. using a radix point in a fixed-sized number calculation Q6: A ___________________________ is a sequence of instructions with a name.

A. variable B. argument C. parameter D. function

Q7: True or False:

a) Audio data is often represented on a computer by sampling the continuous signal that represents a sound wave.

____________

b) An AND gate and an OR gate produce opposite output. ____________

c) Vector graphics represent images in terms of lines and geometric shapes. ____________

d) An absolute path begins at the current working directory. ____________

e) The IP address 121.122.500.124 is valid. ____________

f) RAM is non-volatile and ROM is volatile. ____________

Q8: The gate that produces the opposite results of an AND gate is called a(n) _______________ gate. Q9: A(n) _______________ circuit has multiple gates embedded into it. Q10: IPv4 IP addresses are ___ (2, 8 ,32, or128) bits. Q11: Convert (345.28125)10 to binary number. Show all steps.

Q12: What is the function of the ALU?

Q13: What is difference between Domain name and IP address?

Q14: Give the Boolean expression and draw the truth table for the following circuit

Q15: Write loops that computes a) The sum of all even numbers between 2 and 100 (inclusive). b) The sum of all squares between 1 and 100 (inclusive). c) The sum of all odd numbers between a and b (inclusive). d) The sum of all odd digits of n. (For example, if n is 32677, the sum would be 3 + 7 + 7 = 17.)