Question: How can add the image to this code ....??? package task2; import javax.swing.*; public class GraphicalIO { public static void main(String[] args) { String qty,

How can add the image to this code ....???

package task2;

import javax.swing.*;

public class GraphicalIO { public static void main(String[] args) { String qty, amount, VRateP;

qty = JOptionPane.showInputDialog("Enter the quantity of meal"); while (qty.equals("")){ qty = JOptionPane.showInputDialog("Enter the quantity of meal"); }

amount = JOptionPane.showInputDialog("Enter amount in AED"); while (amount.equals("")){ amount = JOptionPane.showInputDialog("Enter amount in AED"); } VRateP = JOptionPane.showInputDialog("Enter VAT Rate(%)"); while (VRateP.equals("")){ VRateP = JOptionPane.showInputDialog("Enter VAT Rate(%)"); }

double amountToDouble=0, VRatePToDouble=0; int qtyToInt=0; int choice = JOptionPane.showConfirmDialog(null, "If you need the total price press Yes?"); if (choice == JOptionPane.YES_OPTION) { amountToDouble = Double.parseDouble(amount); VRatePToDouble = Double.parseDouble(VRateP); qtyToInt = Integer.parseInt(qty);

double vat = qtyToInt * (amountToDouble * ( 1 + (Double.parseDouble(String.valueOf(VRatePToDouble))/Double.parseDouble(String.valueOf(100)))));

JOptionPane.showMessageDialog(null, "VAT amount in AED " + (vat - amountToDouble) + " Total Amount in AED " + vat); } else { JOptionPane.showMessageDialog(null, "Cancelled."); }

} }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!