import javax.swing.JOptionPane;
public class Example_Maintenance_System{
public static void main (String [] args)
{
//Operator Name Input
String operator_name;
operator_name = JOptionPane.showInputDialog("Please scan your barcode");
//Machine Number Input
String temp_machine_number;
double machine_number;
temp_machine_number = JOptionPane.showInputDialog("Please scan machine barcode");
machine_number = Double.parseDouble(temp_machine_number);
//Coolant Tank
String coolant_level;
Object [] possibilities = {"1/4","1/2","3/4","Full"};
coolant_level = (String)JOptionPane.showInputDialog(null,"Please enter coolant tank level: ", "Coolant Level", JOptionPane.PLAIN_MESSAGE,null, possibilities, "1/4") ;
if (!(coolant_level.equals("3/4")||(coolant_level.equals("Full"))))
JOptionPane.showMessageDialog (null, "Coolant Level Too Low!\n" + "Please Refill", "Alert: Low Coolant", JOptionPane.ERROR_MESSAGE);
else
JOptionPane.showMessageDialog(null, "Coolant Level is Acceptable", "Acceptable", JOptionPane.PLAIN_MESSAGE);
//Dilution - Refractometer Reading
String temp_refract_reading;
double refract_reading;
temp_refract_reading = JOptionPane.showInputDialog("Please enter refract reading");
refract_reading = Double.parseDouble(temp_refract_reading);
if ((refract_reading > 2.6)||(refract_reading < 1.8))
JOptionPane.showMessageDialog (null, "Refract reading is unsatisfactory!\n" + "Please Correct", "Alert", JOptionPane.ERROR_MESSAGE);
else
JOptionPane.showMessageDialog(null, "Refract reading is acceptable", "Acceptable", JOptionPane.PLAIN_MESSAGE);
//pH level
String temp_ph_reading;
double ph_reading;
temp_ph_reading = JOptionPane.showInputDialog("Please enter pH reading");
ph_reading = Double.parseDouble(temp_ph_reading);
if ((ph_reading > 9.5)||(ph_reading < 8.5))
JOptionPane.showMessageDialog (null, "pH reading is unsatisfactory!\n" + "Please Correct", "Alert", JOptionPane.ERROR_MESSAGE);
else
JOptionPane.showMessageDialog(null, "pH reading is acceptable", "Acceptable", JOptionPane.PLAIN_MESSAGE);
//Way Lube Level
String way_lube_level;
way_lube_level = (String)JOptionPane.showInputDialog(null,"Please enter way lube level: ", "Way Lube Level", JOptionPane.PLAIN_MESSAGE,null, possibilities, "1/4") ;
if (!(way_lube_level.equals("3/4")||(way_lube_level.equals("Full"))))
JOptionPane.showMessageDialog (null, "Way Lube Level Too Low!\n" + "Please Refill", "Alert: Low Way Lube", JOptionPane.ERROR_MESSAGE);
else
JOptionPane.showMessageDialog(null, "Way Lube Level is Acceptable", "Acceptable", JOptionPane.PLAIN_MESSAGE);
}
}