Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started