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.printf("Final order amount = $%,.2f\n", finalAmount); } } Group of answer choices
The code in Java implements two classes Order and CustomerOrder
The Order class contains the method for the member variables orderNum,orderAmount and orderDiscounts, It also contains the method finalOrderTotal() for calculating the final order amount
The second class CustomerOrder contains the main method and serves as the driver class.
The finalAmount is calculated in the method finalOrderTotal() and the logic here substracting the discount from the orderAmount that is orderAmount - (orderAmount * orderDiscount)
Since the orderAmount in the given example is 580 and the discount is 0.1 (i.e 58) the finalAmount will be 580 - 58 which gives 522 dollars