shopping [] shop = new shopping[100];
PrintWriter ofile = null;
String pname;
double pprice;
int pbarcode;
int pquantity;
int cmd;
boolean done;
String resp = JOptionPane.showInputDialog( "Choose from:" +
"\n1: Add new products\n2: Shop\n3: Check out ");
cmd = Integer.parseInt(resp);
switch(cmd){
case 1: done = false;
int i = 0;
while(!done){
pname = JOptionPane.showInputDialog("Enter the product name");
pquantity = JOptionPane.showInputDialog("Enter the quantity of that product");
shop p = new shop(pname);
So I am trying to write a program that allows you to go shopping. I am having a problem where I have pquantity = JOptionPane... It keeps telling me to use and int not a string but I have pquantity as an int. HELP?!
This post has been edited by smohd: 10 November 2011 - 02:27 PM
Reason for edit:: Code tags added. Please use [code] tags when posting codes

New Topic/Question
Reply


MultiQuote






|