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
Document preview thumbnail
Preview 2 out of 10 pages
Exam (elaborations)

CS1400 FINAL EXAM QUESTIONS WITH VERIFIED ANSWERS

Document preview thumbnail
Preview 2 out of 10 pages

CS1400 FINAL EXAM QUESTIONS WITH VERIFIED ANSWERS

Content preview

CS1400 FINAL EXAM QUESTIONS WITH VERIFIED
ANSWERS


Fill in the blanks in the correct order.
A _______ is a template or blueprint that is used to create a(n) ____________ of the
same type. - Answers - class, object

A ________________ is used to create an instance of a class. - Answers - constructor

What is the name of the method that is defined to customize an object, and is
automatically called when an instance of a class is created? - Answers - __init__

class A:
def __init__(self):
self.x = 1
self.__y = 2

def getY(self):
return self.__y

a = A()
print(a.__y)

************************What is printed? - Answers - Nothing because y is private

______________________ is way to diagram classes to give a visual representation. -
Answers - UML

What does UML stand for? - Answers - Unified Modeling Language

By convention the word ______________ is used as the first formal parameter of an
instance method. - Answers - self

Which of the following describes Procedural Programming? - Answers - data and
function are separate

- Separation of class implementation from the use of a class
- The implementation details are hidden from the user
- The user knows what the result is, but not how it happens
- A class is like a black box - Answers - Encapsulation and abstraction

What is the name of the built-in function that will return the number of characters in a
string or the number of elements in a list? - Answers - len

, What is the symbol for the Access Operator?
Correct! - Answers - .

Writing code to make it possible to use the // (integer division) symbol on an object is
called - Answers - operator overloading

What is the method that can be defined to change the meaning of the - (minus) symbol?
- Answers - __sub__

class Widget:
def __init__(self, value):
self.value = value
def getMultiple(self, multiplier):
return self.value * multiplier

What is getMultiple? - Answers - method

class Widget:
def __init__(self, value):
self.value = value
def getMultiple(self, multiplier):
multiplier = 5
return self.value * multiplier

What is multiplier? - Answers - local variable

Private data is commonly used inside classes. In order to change this private data a
method can be created. What is the term for this type of method? Choose the most
correct answer. - Answers - setter

class Widget:
def __init__(self, value):
self.value = value
def getMultiple(self, multiplier):
return self.value * multiplier
def __performCalculation(self):
self.value += 10

What is __performCalculation? - Answers - private method

str1 = "Hello"
str2 = "Hello"
print(id(str1))
print(id(str2))
***********

Document information

Uploaded on
July 24, 2026
Number of pages
10
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$14.99

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

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.
GEEKA
3.8
(361)
Sold
2138
Followers
1448
Items
58662
Last sold
10 hours ago


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