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 double finalOrderTotal()
{
Return orderAmount - orderAmount *
OrderDiscount;
}
}
Public class CustomerOrder
{
Public static void main(String[] args)
{
Order order;
Int orderNumber = 1234;
Double orderAmt = 580.00;
Double orderDisc = .1;
Order = new Order(orderNumber,orderAmt,orderDisc) ;
Double finalAmount = order.finalOrderTotal() ;
System.out.println("Final order amount = $" +
FinalAmount) ;
}
}
A) 528.00
B) 580.00
C) 522.00
D) There is no value because the object order has not been created.
Correct Answer:
Verified
Q18: A method that stores a value in
Q23: When an object is created, the attributes
Q25: After the header,the body of the method
Q25: In UML diagrams, this symbol indicates that
Q29: A constructor is a method that:
A) returns
Q31: A class's responsibilities include
A) the things a
Q31: Overloading means multiple methods in the same
Q35: In a UML diagram to indicate the
Q47: Quite often you have to use this
Q57: Look at the following statement. import java.util.*;
This
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