Question: import javax.swing.JOptionPane; public class Project6 { public static void main (String args[]) { String p, q, s, u, v; float x, y, a, b, z,

import javax.swing.JOptionPane;

public class Project6 { public static void main (String args[]) { String p, q, s, u, v; float x, y, a, b, z, t, r, n, m; p=JOptionPane.showInputDialog("Enter your Budget"); z=Float.parseFloat(p); q=JOptionPane.showInputDialog("Enter the price of Salmon"); x=Float.parseFloat(q); s=JOptionPane.showInputDialog("Purchased Fish (in KG)"); a=Float.parseFloat(s); m=x*a; JOptionPane.showMessageDialog(null,"Total price of Salmon:"+m, "Fish", JOptionPane.PLAIN_MESSAGE); u=JOptionPane.showInputDialog("Enter the price of milk (in LTR)"); y=Float.parseFloat(u); v=JOptionPane.showInputDialog("Purchased Milk (in LTR)"); b=Float.parseFloat(v); n=y*b; JOptionPane.showMessageDialog(null,"Total price of Milk:"+n, "Milk", JOptionPane.PLAIN_MESSAGE); JOptionPane.showMessageDialog(null,"Total Budget:"+z, "Budget", JOptionPane.PLAIN_MESSAGE); t=m+n; JOptionPane.showMessageDialog(null,"Total Expenditure:"+t, "Expenditure", JOptionPane.PLAIN_MESSAGE); r=z-t; JOptionPane.showMessageDialog(null,"Remaining Balance:"+r, "Remaining", JOptionPane.PLAIN_MESSAGE); String message= String.format("Total Budget: "+z+" \t Price ofSalmon: "+m+" \t Price of Milk:"+n+" \t Total Expenditure:"+t+" \t Remaining Balance:"+r); JOptionPane.showMessageDialog(null, message); } } Error:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: JOptionPane cannot be resolved JOptionPane cannot be resolved JOptionPane cannot be resolved JOptionPane cannot be resolved JOptionPane cannot be resolved to a variable JOptionPane cannot be resolved JOptionPane cannot be resolved JOptionPane cannot be resolved JOptionPane cannot be resolved to a variable JOptionPane cannot be resolved JOptionPane cannot be resolved to a variable JOptionPane cannot be resolved JOptionPane cannot be resolved to a variable JOptionPane cannot be resolved JOptionPane cannot be resolved to a variable JOptionPane cannot be resolved

at MIS/mis.Project6.main(Project6.java:8) Please help me fix this!

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!