Select The Lesson:
Welcome to Online Education Of Sri Lanka
/*eduLanka Online education web site of Sri Lanka -------- w w w . e d u L a n k a . c o m ------------ java programs for University students - who follow courses - BIT - SLIIT and more find more lessons in http://www.it.edulanka.com eduLanka@gmail.com this programs under GNU licence */ import TerminalIO.*; class MenuDisplay{ public static void main(String[]arg){ KeyboardReader input=new KeyboardReader(); int x=0,y=0,op; System.out.println("\n\nThis program allow you to add and subtract\n\t\ttwo integer numbers");; x=input.readInt("\n Enter the First Integer Number : "); y=input.readInt("\n Enter the Second Integer Number : "); do{ System.out.println("\n\nYou can do the followings: "); System.out.println("1. Addition"); System.out.println("2. Substraction"); System.out.println("3. Multiply"); System.out.println("4. Devide"); System.out.println("5. Exit"); System.out.println("\n\nEnter your Option [1/2/3/4/5]"); op=input.readInt(); System.out.println("\n\n"); switch(op) { case 1: { System.out.println(x+"+"+y+"="+(x+y)); break; } case 2: { System.out.println(x+"-"+y+"="+(x-y)); break; } case 3: { System.out.println(x+"*"+y+"="+(x*y)); break; } case 4: { System.out.println(x+"/"+y+"="+(x/y)); break; } } } while(op!=5); } }