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)

CSCI 2010 - Quiz 1-10 and answers verified to pass 2025

Rating
-
Sold
-
Pages
19
Grade
A+
Uploaded on
18-04-2025
Written in
2024/2025

CSCI 2010 - Quiz 1-10 and answers verified to pass 2025 Only one constructor may be defined per class. - correct answer False What is a method? - correct answer A member of a class that defines an operation on an object. A classed called Printer has a method called printDocument. This calls a void method in the Printer class called printPage that takes an integer representing the page number as an argument. How should printDocument call printPage with an argument of 4? - correct answer printPage(4); Given a class called Rectangle with a constructor that takes two doubles as arguments representing the dimensions, which of the following is the correct way to invoke that constructor? - correct answer Rectangle rect = new Rectangle(8.2, 3.5); Consider the following code: Employee emp1 = new Employee(); Name("Anna Karenina"); Employee emp2 = new Employee(); Name("David Copperfield"): emp2 = emp1;

Show more Read less
Institution
CSCI 2010
Course
CSCI 2010

Content preview

CSCI 2010 - Quiz 1-10 and answers
verified to pass 2025
Only one constructor may be defined per class. - correct answer ✔False


What is a method? - correct answer ✔A member of a class that defines an
operation on an object.


A classed called Printer has a method called printDocument. This calls a void
method in the Printer class called printPage that takes an integer representing
the page number as an argument. How should printDocument call printPage
with an argument of 4? - correct answer ✔printPage(4);


Given a class called Rectangle with a constructor that takes two doubles as
arguments representing the dimensions, which of the following is the correct
way to invoke that constructor? - correct answer ✔Rectangle rect = new
Rectangle(8.2, 3.5);


Consider the following code:


Employee emp1 = new Employee();
emp1.setName("Anna Karenina");
Employee emp2 = new Employee();
emp2.setName("David Copperfield"):
emp2 = emp1;


Which of the following best describes the contents of the two variables emp1
and emp2 after this code has executed? - correct answer ✔emp1 refers to
the object with the name Anna Karenina. emp2 refers to the same object.

,Given the following method header:


public double computeArea(double length, double width)


Which of the following would be a legal overloaded method in the same class?
- correct answer ✔public double computeArea(double length)


When calling a method from another method in the same class, the form
methodName() is equivalent to this.methodName(). - correct answer ✔True


Regular methods may be overloaded, but a constructor may not be
overloaded. - correct answer ✔False


All methods must return a value. - correct answer ✔False


What is the difference between a static variable and an instance variable? -
correct answer ✔A static variable is shared by all objects of a class. Every
object has its own version of an instance variable.


What is decompostion? - correct answer ✔A design strategy that breaks a
task down into several subtasks.


What is the difference between an accessor method (or getter) and a mutator
method (or setter)? - correct answer ✔An accessor method returns data
contained in an instance variable. A mutator method modifies data contained
in an instance variable.


Given the following header for a method in the class Demo:

, public static double smallest(double[] data)


Which of the following is the correct way to call this method, given an array of
doubles called values? - correct answer ✔double min =
Demo.smallest(values);


Given the following initial array:


{'P', 'A', 'U', 'S'}


Which of the the following correctly illustrates the sequence of passes
performed by selection sort? - correct answer ✔{'P', 'A', 'U', 'S'}
{'A', 'P', 'U', 'S'}
{'A', 'P', 'U', 'S'}
{'A', 'P', 'S', 'U'}


Assume there is a class called Trombone with a default constructor. Which of
the following is the correct way to create and initialize an array of 76
Trombone objects? - correct answer ✔Trombone[] marchingBand = new
Trombone[101];for(int i = 0; i < marchingBand.length; i++)marchingBand[i] =
new Trombone();


Given an array called items, what is the correct way of determining the
number of elements in the array? - correct answer ✔items.length


Which of the following is the correct way to declare an array of 12 integers in
Java? - correct answer ✔int[] numbers = new int[12];

Written for

Institution
CSCI 2010
Course
CSCI 2010

Document information

Uploaded on
April 18, 2025
Number of pages
19
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$17.99
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


Also available in package deal

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.
flyhigher329 Liberty University
Follow You need to be logged in order to follow users or courses
Sold
372
Member since
3 year
Number of followers
175
Documents
18116
Last sold
1 week ago
STUDY GUIDES &amp; ALL NURSING AND MORE EXAMS(RATED A+)

ARE YOU LOOKING FOR EXAMS!! MAY IT BE NURSING,EMT,REALTORS e.t.c WELCOME TO OUR SHOP FOR ALL YOU NEED TO PASS COZ WE ARE VERIFIED AND GUARANTEED TO PASS, DONT FORGET TO GIVE A REVIEW AFTER YOU HAVE PASSED THE EXAMS.........

3.8

60 reviews

5
26
4
10
3
14
2
4
1
6

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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions