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

CSE 1321 FINAL EXAMS 2026.pdf

Document preview thumbnail
Preview 2 out of 8 pages

CSE 1321 FINAL EXAMS

Content preview

CSE 1321 FINAL EXAMS 2026/2027 QUESTIONS AND
SOLUTIONS RATED A+
✔✔In the following code, PRINT(num) is an example of _________.
num ← 5.4
PRINT(num)
num ← 0.0 - ✔✔a void method call

✔✔This part of a method is a collection of statements that are performed when the
method is executed. - ✔✔Method body

✔✔Values that are sent into a method are called ________. - ✔✔actual parameters or
arguments

✔✔When you pass an argument to a method, be sure that the argument's data type is
compatible with: - ✔✔The parameter variable's data type or intended use of the
parameter.

✔✔When code in a method changes data passed by value into its parameter, the
original piece of data is also changed. - ✔✔False

✔✔A parameter variable's scope is: - ✔✔The method in which the parameter is
declared.

✔✔The lifetime of a method's local variable is: - ✔✔Only while the method is executing.

✔✔What will be returned from the following method?
METHOD addTwoNums()
a ← 8.5 + 9.5
return a
END addTwoNums - ✔✔18.0

✔✔This type of method performs a task and then terminates. - ✔✔void

✔✔Which of the following would be a valid method call for the following method?

METHOD showProduct (parameters: num1, num2)
product = num1 * num2
PRINT("The product is " + product)
END showProduct - ✔✔showProduct(10, 4);

✔✔When passing by reference, it is actually a reference to the original place in memory
of the object that is passed. - ✔✔True

, ✔✔The body of a method is demarcated by: - ✔✔{ } or indentation, as dictated by the
language syntax.

✔✔This keyword causes a method to end and sends a value back to the statement that
called the method. - ✔✔return

✔✔A function header is a complete statement and should be terminated according to
the rules of the language you are using. - ✔✔False

✔✔Arguments passed to a method MUST be passed in the same order that the
parameters are defined in the method header. - ✔✔True

✔✔All methods must be called from the main method. - ✔✔False

✔✔This is a control structure that causes a statement or group of statements to repeat.
- ✔✔Loop

✔✔If a loop does not contain within itself a way to terminate, it is called a(n): -
✔✔Infinite loop.

✔✔Each repetition of a loop is known as what? - ✔✔An iteration

✔✔What will be the value of x after the following code is executed?
x←0
WHILE ( x < 5 )
x←x+1
ENDWHILE - ✔✔5

✔✔In the following code, what values could be read into number to terminate the while
loop?
PRINT "Type in a number"READ input
number ← user input
WHILE ( number > 0 )

PRINT "No, that is not it. Try again."
READ input
number ← user input

ENDWHILE - ✔✔Numbers less than or equal to zero

✔✔What will be the value of x after the following code is executed?
x←1
WHILE (x < 0)
x←x+1

Document information

Uploaded on
July 21, 2026
Number of pages
8
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$17.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.
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