100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COMP 208 Final Exam 2023 Questions and Answers with complete solution $13.49   Add to cart

Exam (elaborations)

COMP 208 Final Exam 2023 Questions and Answers with complete solution

 1 view  0 purchase
  • Course
  • Institution

COMP 208 Final Exam 2023 Questions and Answers with complete solution Why are computers designed to run programs from RAM and not from the hard disk? A) Because it is impossible to run program from the hard disk. B) Because the hard disk, compared to RAM, is very slow. C) A program, on the ...

[Show more]

Preview 3 out of 17  pages

  • March 29, 2023
  • 17
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
avatar-seller
COMP 208 Final Exam 2023 Questions and Answers with
complete solution
Why are computers designed to run programs from RAM and not from the hard disk?

A) Because it is impossible to run program from the hard disk.
B) Because the hard disk, compared to RAM, is very slow.
C) A program, on the hard disk, cannot be modified.
B
Write the binary code (binary number) for the character D (capital letter D).
01000100
Why does the computer only store information in binary?

A) Because binary arithmetic is fun.
B) Computers can store more information using binary codes than any other way.
C) This is not true. Computers do not only understand binary.
D) Because it is made from transistors and they only have two states: charge and
discharge.
D
Write: megabyte, gigabyte, or terabyte in the space provided, for the following:
100,000,000 bytes
How would the above number be best described?
Do not write numbers, only write the word that best fits the number. Write it in the same
case as shown above
megabyte
Assume this binary 00000101 number is an integer. What value is it in decimal?
5
Since computer arithmetic has finite precision, is it true that we could carry out all our
arithmetic in fraction notation in order to not loose precision? (True/False)
True
Which statement is true given this Python statement? (assume it is indented)
print("hello)

A) This statement does not exist in Python.
B) Error: missing a closing double quote and it needs a terminating semi-colon.
C) It will still run, even though is it missing a closing double quote.
D) Error: missing a closing double quote
D
What does the following print to the screen?
print("John is ", 5, "years old.", " And 5 is ", type(5))
John is 5years old. And 5 is <class 'int'>
Assuming we have the following equation in Python, what would be outputed?
print(5 + 2 * 2)
25.0

,What does the term string mean?

A) It is a physical object used to tie things together.
B) All the statements that compose a program are known collectively as a string.
C) A finite series of symbols concatenated together.
D) It is an integer number.
C
Which print() statement is wrong?

A) print("Hello","World")
B) print('Hello "World"')
C) print('Hello World")
D) print("Hello World");
C
Which of the following is NOT true about the empty string.

A) The empty space takes up no space in RAM
B) print(len("")) gives 0
C) print("") gives no output other than a new line
D) The symbol that represents the empty string is ""
A
What is the output of
print(5 + 5)

Write a single value
10
What is the output of
print("5" + "5")

Write a single value
55
Assume we have this code:
x = "My name is bob"
print(x[3:6])

What is printed to the screen?
nam
One reason why variables are useful is because we can store the result of a
computation in a variable and use it later without having to recompute the value.
(True/False)
True
Which way to declare a variable is NOT correct?

A) x, y = 10, 20
B) x = 5

, C) int x
D) All of the above are correct
C
Given the following code:
x = 10y = 20
y=x

Select the sentence that is true:

A) The value 20 is deleted by Python and no longer exists.
B) Python backs-up the number 20 in RAM and can be accessed later.
C) The above code results in a run-time error.
D) The value 20 is overwritten by the number 10 and no longer exists.
D
The equal sign (=) in Python does not have the same meaning as in Math. In Python it
means assign (change the value in a variable to a new value). In Math it means the
equations on either side of the equal result in the same solution. (True/False)
True
Given the following code:

def compute(x):
y = x**3
z = (2 * x) + 5
return (y + z)

print(compute(2))

What value is printed to the screen?
17
The boolean True and False are strings. (True/False)
False
What does 10==5 result in Python

A) True
B) Syntax error
C) False
C
What does x = not (5 <10) result in Python? (what does x get?)

A) Syntax error
B) False
C) True
B
What does "moon".upper() != "moon" in Python?

A) False

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller magdamwikash23. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $13.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

67163 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$13.49
  • (0)
  Add to cart