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

CSCI 1103 Final Exam Questions and Answers| Latest Update

Document preview thumbnail
Preview 2 out of 7 pages

CSCI 1103 Final Exam Questions and Answers| Latest Update

Content preview

CSCI 1103 Final Exam Questions and Answers|
Latest Update

A variable declared as type double can store _____________________. ✔️✔️a 64-bit value used
to represent numbers with fractional parts


A graphical interface used to develop and debug Java programs is called:
_______________________________. ✔️✔️an Integrated Development Environment (IDE)


Assume the following (int) values for a set of variables:
a = 5; b = 17; c = 27; d = -1;
Then, does the following boolean expression evaluate as true or false?

((a < 5) && (b > 10)) || ((c < 3) || (d < 0)) ✔️✔️true


If you want to compare the String variable myvar and the literal "Yes" which boolean expression
would you use? __________________________ ✔️✔️("Yes".equals(myvar))


Which of the following can be used in the boolean condition of a Java if statement?
___________________. ✔️✔️All of the above



The following are Java loop control structures: __________________________. ✔️✔️all of the
above



A do-while loop always executes _____________________. ✔️✔️one or more times


Consider the following code fragment:
for (int i=5; i<=7; ++i) { System.out.println(i); }

The code will print: ✔️✔️5

, 6
7


Consider the following code fragment:
for (int i=0; i<10; ++i) {
for (int j=0; j<10; ++j) {
System.out.println("Hello");
}
}

How many times does the code fragment print the word "Hello"? ✔️✔️100 times



Which of the following means the same as object? ✔️✔️instance



Which of the following means the same as instance variable? ✔️✔️field



Which of the following is the most likely scenario for a specific class? ✔️✔️Its data fields are
private and its methods are public.


Assume that you have created a class named Dog that contains a data field named weight and
an instance method named setWeight(). Further assume that the setWeight() method is public
and accepts a numeric parameter named pounds. Which of the following statements correctly
sets a Dog's weight within the setWeight() method? ✔️✔️weight = pounds



Which method is automatically called when a Java object is instantiated? ✔️✔️Constructor



A Java object can be a field in another Java object. ✔️✔️True



Which of the following pairs is an example of an is-a relationship? ✔️✔️Laptop, Computer

Document information

Uploaded on
March 22, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.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.
KateJones
4.8
(12)
Sold
30
Followers
0
Items
5048
Last sold
2 weeks ago


Reviews from verified buyers



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