Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

COMP 208 Final Exam 2023 Questions and Answers with complete solution

Rating
-
Sold
-
Pages
17
Grade
A+
Uploaded on
29-03-2023
Written in
2022/2023

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). 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 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 + 10 / 2 2 * 2) 25.0

Show more Read less
Institution
Course

Content preview

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

Written for

Course

Document information

Uploaded on
March 29, 2023
Number of pages
17
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$13.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
magdamwikash23 Western Governers University
Follow You need to be logged in order to follow users or courses
Sold
113
Member since
3 year
Number of followers
94
Documents
5328
Last sold
1 month ago
Magda

NURSING STUDY GUIDES/EXAMS AND NOTES ALL VERIFIED BY EXPERTS All my uploaded documents, exams and essays are verified by relevant experts.I can assure an A or at least 90% if you use any of my documents.

3.9

14 reviews

5
7
4
2
3
2
2
2
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions