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 11 pages
Exam (elaborations)

CSE 1321 EXAMS SCRIPT 2026.pdf

Document preview thumbnail
Preview 2 out of 11 pages

CSE 1321 EXAMS SCRIPT

Content preview

CSE 1321 EXAMS SCRIPT 2026/2027 QUESTIONS AND
SOLUTIONS RATED A+
✔✔Array indexes always starts at what value? - ✔✔0

✔✔What will be the value of x[3] after the following code has been executed?

Create array x [5]
y←0
FOR (i = 0, i < 5, i++)
x[i] ← y
y ← y + 10
ENDFOR - ✔✔x = [0,10,20,30,40]
x[3] is 30
Answer: 30

✔✔What will be the results of the following code?

ARRAY_SIZE ← 5
Create array x [ARRAY_SIZE]
FOR (int i = 0, i < length of x, i++)
x[i] ← 10
ENDFOR - ✔✔All the values in the array are initialized to 10

✔✔What would be the results of the following code?

Create array1 ← [33, 88, 11, 44, 99, 55]
value ← array1[0]
FOR (int i = 0, i < length of array1, i++)
IF(array1[i] < value) THEN
value ← array1[i]ENDIFENDFOR - ✔✔Value contains the lowest value in array1.

✔✔What would be the value of x[1] after the following code is executed?

Create array x [22, 33, 44]
CALL ARRAY_PROCESS with x
...
METHOD ARRAY_PROCESS(parameter [] a)
BEGIN
FOR (int i = 0, i < length of x, i++)
a[i] ←a[i] + 5
ENDFOR
END ARRAY_PROCESS - ✔✔38

✔✔For the following code, what would be the value of str[2]?

, Create array myStrings ← ["abc", "def", "ghi", "jkl"] - ✔✔A reference to the string "ghi"

✔✔The index of the center position of a 3*3 2D array would be: - ✔✔[1][1]

✔✔Choose the answer that best describes the array created upon executing the
following:

Create array myStudents[30][6] - ✔✔Creates a 2D array with 30 rows and six columns

✔✔What value is stored in myNumbers[1][2] after the following code executes:

y←3
Create array myNumbers[3][4]FOR rows in myNumbersFOR columns in myNumbers
myNumbers ← y y ← y + 2
ENDFORENDFOR - ✔✔15

✔✔Select the code you would use to create a 2D array with 5 rows and 12 columns. -
✔✔Create array myNums[5][12]

✔✔The visibility level of a class field should be. - ✔✔private

✔✔A field can be of any data type that is legal in the language you are using. - ✔✔True

✔✔A class field is also known as a(n): - ✔✔attribute

✔✔A class is analagous to a(n) - ✔✔blueprint

✔✔An object is a(n) - ✔✔instance of the class

✔✔This is a method that is automatically called when an instance of a class is created. -
✔✔constructor

✔✔If you write a constructor for a class, it should initialize all class fields. - ✔✔True (not
false, "should")

✔✔This keyword is used to indicate a field belongs to a class, and not an instance. -
✔✔static

✔✔The new keyword makes a call to a class's constructor. - ✔✔True

✔✔Each instance of a class has its own set of fields. - ✔✔True

Document information

Uploaded on
July 21, 2026
Number of pages
11
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$18.49

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.
BOARDWALK
3.5
(40)
Sold
276
Followers
8
Items
32861
Last sold
5 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