//please do not copy this it is not complete so you will get it wrong it is only for studying purpose and any questions are to be emailed to me import javax.swing.*;//imports the java swing package which makes the fancy boxes public class // this declears the main class which ive chosen to call inputand output you can call it anything you like { public static void main (String[] args)//this is the main method which initialises the string and the arguments to be used { String totalfines; int a,b;//this decleares the integers to be used or "numbers" variables in the program so you can use the words like numbers after you have initialised them JOptionPane.showMessageDialog(null,"THis program will enable you to calculate total fines");//this is just a dialog box that diaplays a message that you can change what you can change is under " " marks //the rest in essential to display the message totalfines = JOptionPane.showInputDialog("Please input the total fines");//this is an input box this box links the String we declared earlier(examresult) to whatever anyone types into the box total = Integer.parseInt(totalfines); if (total >= 500) { JOptionPane.showMessageDialog(null,"YOU CANNOT BORROW"); } if (total < 500) { JOptionPane.showMessageDialog(null,"YOU CAN BORROW"); } JOptionPane.showMessageDialog(null," "); System.exit(0);//this exits the system } }