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 3 out of 20 pages
Exam (elaborations)

CSCI 1301 final exam study guide Questions Exam With Complete Solutions

Document preview thumbnail
Preview 3 out of 20 pages

CSCI 1301 final exam study guide Questions Exam With Complete Solutions Graded A+

Content preview

CSCI 1301 final exam study guide Questions Exam
With Complete Solutions
Graded A+

QUESTIONS AND ANSWERS

Which of the following declares a variable that will store a measurement with fractional
parts?


A) int measure;
B) double measure;
C) String measure;
D) integer measure; ANSWER -B) double measure;


Assuming that the user inputs "Joe" at the prompt, what is the output of the following code
snippet?


A) The code snippet does not compile because the += operator cannot be used in this
context
B) Joe, Good morning
C) , Good morning
D) Joe ANSWER -B) Joe, Good morning


The assignment operator


A) denotes mathematical equality
B) places a new value into a variable
C) means the same as the equal sign used in algebra
D) makes it illegal to write a statement like "sum = sum + 4" ANSWER -B) places a new
value into a variable


What term is used to refer a to a sequence of characters enclosed in quotation marks?

,A) string
B) object
C) comment
D) variable ANSWER -A) string


What is the result of the following statement
String s = "You" + "had" + "me" + "at" + "hello";


A) The string s has the following value: "You had me at hello"
B) The statement results in an error because the + operator can be only used with numbers
C) The statement results in an error because the + operator cannot be performed on string
literals
D) The string s has the following value: "Youhadmeathello" ANSWER -D) The string s
has the following value: "Youhadmeathello"


A method may be called by specifying which 3 items in the specified order? ANSWER -
Object, method name, parameters


When a Java application starts, what is the name of the method that is executed?


A) main
B) start
C) begin
D) Main ANSWER -A) main


What will be printed by the statement below
int x = 20;
int y = x;
x += 3;
y *= 2;
System.out.print("x = " + x + ", y = " + y);

, A) x = 23, y = 46
B) x = 23, y = 40
C) x = 46, y = 46
D) x = 3, y = 2 ANSWER -B) x = 23, y = 40


Assuming the following Java statement


Circle cl = new Circle (3);


What does the variable c1 store?


A) The constructed object itself
B) A reference to the circle class
C) A reference to the memory location of the constructed object
D) The numeric value 3 ANSWER -C) A reference to the memory location of the
constructed object


Assume a, b, and c have been defined to be integer variable. Which of the following value
makes the expression below true?


! (a == b) && (c > a)


A) a = 10, b = 10, c = 15
B) a = 10, b = 20, c = 15
C) a = 10, b = 2, c = 5
D) a = 10, b = 20, c = 10 ANSWER -B) a = 10, b = 20, c = 15


Parameters and local variables belongs to ________________ ANSWER -Methods


Instances variables belong to ________________ ANSWER -Objects


static variable belong to ________________ ANSWER -Classes

Document information

Uploaded on
January 5, 2026
Number of pages
20
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$11.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

Sold
8
Followers
0
Items
1069
Last sold
1 month 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