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.println("Final order amount = $" +
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.
Correct Answer:
Verified
Q12: One or more objects may be created
Q14: The scope of a private instance field
Q15: For the following code,which statement is not
Q17: A constructor:
A) always accepts two arguments
B) has
Q18: What does the following UML diagram entry
Q22: Which of the following is not involved
Q25: In UML diagrams, this symbol indicates that
Q25: After the header,the body of the method
Q41: Look at the following statement. import java.util.Scanner;
This
Q50: The scope of a public instance field
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents