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

CS 1103 Final Exam Questions and Answers- University of the People

Rating
-
Sold
-
Pages
18
Grade
A
Uploaded on
16-08-2022
Written in
2022/2023

CS 1103 Final Exam Questions and Answers- University of the People/CS 1103 Final Exam Questions and Answers- University of the People/CS 1103 Final Exam Questions and Answers- University of the People/CS 1103 Final Exam Questions and Answers- University of the People/CS 1103 Final Exam Questions and Answers- University of the People

Show more Read less
Institution
Course

Content preview

Question 1
Answer saved
Marked out of 1.00




Flag question

Question text

Which of the following statements are true?

Select one or more:

a. The Collection interface is the root interface for manipulating a collection of objects.

b. The Collection interface provides the basic operations for adding and removing elements in
a collection.

c. The AbstractCollection class is a convenience class that provides partial implementation for
the Collection interface.

d. Some of the methods in the Collection interface cannot be implemented in the concrete
subclass. In this case, the method would throw java.lang.UnsupportedOperationException, a
subclass of RuntimeException.

e. All interfaces and classes in the Collections framework are declared using generic type in JDK
1.5.

Question 2
Answer saved
Marked out of 1.00




Flag question

Question text

Which of the following statements are true?

Select one or more:

a. Dialog boxes are defined by subclasses of the class JDialog.

b. The main difference between JDialogs and JFrames is that a dialog box has a parent, which if
closed, causes the dialog box to closes, too.

,c. When a modeless dialog is put up on the screen, the rest of the application is blocked until
the dialog box is dismissed.

d. Modal dialog boxes are like independent windows, since they can stay on the screen while
the user interacts with other windows.

Question 3
Answer saved
Marked out of 1.00




Flag question

Question text

What code is missing to complete the following method for sorting a list?
public static void sort(double[] list) {
___________________________;
}
public static void sort(double[] list, int high) {
if (high > 1) {
// Find the largest number and its index
int indexOfMax = 0;
double max = list[0];
for (int i = 1; i <= high; i++) {
if (list[i] > max) {
max = list[i];
indexOfMax = i;
}
}
// Swap the largest with the last number in the list
list[indexOfMax] = list[high];
list[high] = max;
// Sort the remaining list
sort(list, high - 1);
}
}

Select one:

, a. sort(list)

b. sort(list, list.length)

c. sort(list, list.length - 1)

d. sort(list, list.length - 2)
Clear my choice

Question 4
Answer saved
Marked out of 1.00




Flag question

Question text

What does this code do?

import java.io.*;
// (TextReader.class must be available to this program.)
public class TenLinesWithTextReader {
public static void main(String[] args) {
try {
TextReader in = new TextReader( new FileReader(args[0]) );
for (int lineCt = 0; lineCt < 10; lineCt++)) {
String line = in.getln();
System.out.println(line);
}
}
catch (Exception e) {
System.out.println("Error: " + e);
}
}

} // end class TenLinesWithTextReader

Select one:

a. This code accesses a remote computer and requests 10 HTML pages.

b. This code displays the first ten lines from a text file. The lines are written to standard output.

Written for

Course

Document information

Uploaded on
August 16, 2022
Number of pages
18
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

€15,80
Get access to the full document:

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

Get to know the seller

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.
Millenialnurse Freelance Tutor
Follow You need to be logged in order to follow users or courses
Sold
252
Member since
4 year
Number of followers
147
Documents
1482
Last sold
3 weeks ago
Genuine Study Guides 2024

Holla me for assistance 24/7.

3,4

37 reviews

5
17
4
4
3
4
2
2
1
10

Recently viewed by you

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

Frequently asked questions