Question: Subject: Java programming When i go run this program it says the vaule of the local vairiable is not used; can someone provide assistance on

Subject: Java programming

When i go run this program it says the vaule of the local vairiable is not used; can someone provide assistance on this Java code. Thank you

package pet_lab_sept_19;

import javax.swing.JOptionPane;

public class pet_lab_sept_19

{

public static void main(String[] args)

{

String pet,temp;

double payment;

double dog_total=0,cat_total=0,other_total=0,total_payment=0;

int dog=0,cat=0,other=0;

String more_data="yes";

String most_pets="";

while(more_data.equals("yes"))

{

//********************Beginning of loop

pet=JOptionPane.showInputDialog(null,

"Enter the pet type ", "",JOptionPane.QUESTION_MESSAGE);

temp=JOptionPane.showInputDialog(null,

"Enter the payment for the appointment ", "",JOptionPane.QUESTION_MESSAGE);

payment = Double.parseDouble(temp);

more_data=JOptionPane.showInputDialog(null,

"Enter more ? yes/no", "",JOptionPane.QUESTION_MESSAGE);

//******************End of loop

}//end of while

System.exit(0);

}

}

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!