Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the code: package mis; import javax.swing.JOptionpane; public class Project { public static void main (String args[]) { String p, q, s, u, v; float x,

image text in transcribed

the code:

package mis;

import javax.swing.JOptionpane; public class Project { 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

......................

Please tell me where and what i am doing wrong and how to fix it.

jej w DOCKRONIS: inport javax.swirs. Joptionpane: public class Project { wie sie vold (String []) C Step, . , ; Hot X, Y., B., , , , p-optiorPanc.showinputsslopi Enter your budget); 2- ost.parsel Lotip): -10ojo Pane showinputDate("Cuter the price of Sale); s-10ptionPanc. Show Inpatinio purchased Fish in R63": S-1001-parseFLOOT(s); th="; JOptionPane.shootless agebision." stal price of Salon", "ish, OptionPane. PLAIN_MESSE) -10 Prestwinpoiluetter the prio fill in th); V-optionPane.showInputbalorPurchased ik in LTRS": bot.parsel lect(): -"b: Colorare shortes savist price ut Milk "+"Will, pime. PLATN_MESSAGD); notione caute sapetabou Tatal der ", "Ruder", aptionPane.PL 4TH_NFS546F), ten JOptionPene.shoutissageislogna, Ital Expenditure: "+1, "Expenditure", UptionPane.PLAY MESSIGE); -2-t; Bol Pareshoots AeDialo), inimal","Restine", P. PLATN_MSGK); Staire possac-St-forset( Total Hudget. "131"\ot Trice at alam 1 Teace of mikinit tatt Reining Falancer). optionPane.shoulossa cialo FCRC); Arait terminated Proiect Java Application yeclipse Plugusora.elper.scper dienstspotre3.BC_G_1.01.2LOTUET Corean ww. Mar 12.221.210M - 49 PM opentanco onant camos de tod, to avoid DE Om mit JOB Indone anot be S.Diet ay

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Write the products of the following reactions

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago