Question: 18) Given the following code, what will be the value of finalAmount when it is displayed? 18) public class order private int orderNumber private double

18) Given the following code, what will be the value of finalAmount when it is displayed? 18) public class order private int orderNumber private double orderAmount private double orderDiscount; public Order (int orderNum, double orderAmt, double orderDisc) orde rNum = orde rNumber; orderAmount # orderAmt ; orderDiscountorderDisci public double getorderAmount return orderAmount; public double getorderDiscount ) return orderDiscounti import java.text. NumberFormat public class Customerorder public static void main(stringt args) int ordNum1234: double ordAmount 580.00 double discountPer 0.10 order orders new Order (ordNum, ordAmount, discountPer) double finalAmount finalAmount- orders.getorderA mount )-orders.getorderAmount ) orders.getorderDiscount ) NumberFormat fmt- NumberFormat.getCurrencyInstance) system.out.printin( Pinal order amount : t mt. format system.out.println ("Pinal order amount:t. (finalAmount))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
