100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

COSC 2436 - Exam 1 Questions and Answers

Rating
-
Sold
-
Pages
16
Grade
A+
Uploaded on
06-12-2025
Written in
2025/2026

COSC 2436 - Exam 1 Questions and Answers

Institution
COSC
Course
COSC










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
COSC
Course
COSC

Document information

Uploaded on
December 6, 2025
Number of pages
16
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COSC 2436 - Exam 1 Questions and
Answers16

Given the following code, what will be the value of finalAmount when it is displayed?



public class Order

{

private int orderNum;

private double orderAmount;

private double orderDiscount;

public Order(int orderNumber, double orderAmt, double orderDisc)

{

orderNum = orderNumber;

orderAmount = orderAmt;

orderDiscount = orderDisc;

}

public int getOrderAmount()

{

return orderAmount;

}

public int getOrderDisc()

{

return orderDisc;

}

}

,public class CustomerOrder

{

public static void main(String[] args)

{

int ordNum = 1234;

double ordAmount = 580.00;

double discountPer = .1;

Order order;

double finalAmount = order.getOrderAmount() —

order.getOrderAmount() * order.getOrderDisc();

System.out.printf("Final order amount = $%,.2f\n", finalAmount);

}

}



A) 528.00

B) 580.00

C) There is no value because the constructor has an error.

D) There is no value because the object, order, has not been created. - ANSWERS-D) There is no
value because the object, order, has not been created.



Two or more methods in a class may have the same name as long as __________.



A) they have different return types

B) they have different parameter lists

C) they have different return types but the same parameter list

D) You cannot have two methods with the same name. - ANSWERS-B) they have different
parameter lists

, When an object is created, the attributes associated with the object are called __________.



A) instance fields

B) class instances

C) instance methods

D) fixed attributes - ANSWERS-A) instance fields



Methods that operate on an object's fields are called __________.



A) instance variables

B) instance methods

C) public methods

D) private methods - ANSWERS-B) instance methods



The __________ package is automatically imported into all Java programs.



A) java.java

B) java.default

C) java.util

D) java.lang - ANSWERS-D) java.lang



Given the following two-dimensional array declaration, which statement is true?

int[][] numbers = new int[6][9];



A) The numbers array has 54 rows.

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.
Bensuda Oxford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
847
Member since
3 year
Number of followers
445
Documents
21474
Last sold
2 days ago
ECONOMICS,NURSING,BIOLOGY AND ALL REVISION MATERIALS

DEDICATED TO PROVIDE YOU WITH THE BEST LEARNING MATERIALS THAT WILL IMPROVE YOUR GRADES ,WELCOME TO ALIZGRADES AND LETS DO IT TOGETHER!!! GOODLUCK!!!!!!!

3.7

158 reviews

5
74
4
24
3
25
2
11
1
24

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