About Me

I dont want to tell 2 much bout my self coz you will nkow me personally than to judge me from what you hear and see bout me... hmm......... i will react the way you show your guisture but still i can hold my temper if needed.. ... I an a band member.. I am also a vocalist in an underground band. i am also a composer.. in fact i have composed several songs for polititian here in mati city. more bout that ?? single pako only 4 a moment.. jejeje ect,,

Monday, July 12, 2010

ADDD

import javax.swing.JOptionPane;
/* * To change this template, choose Tools Templates * and open the template in the editor. */
/** * * @author user */public class Add {public static void main (String[]args){ JOptionPane.showMessageDialog(null,"Welcome !!!\nhehehe","",JOptionPane.INFORMATION_MESSAGE);
String firstNumber = JOptionPane.showInputDialog("Enter First Number:");
String secondNumber = JOptionPane.showInputDialog("Enter Second Number:");
String operation = JOptionPane.showInputDialog("Choose operation:\n1.Addition\n2.Sabtruction\n3.Multiplication\n4.Divided");
int number1 = Integer.parseInt(firstNumber); int number2 = Integer.parseInt(secondNumber); int OP = Integer.parseInt(operation); if(OP == 1){ int sum = number1 + number2; JOptionPane.showMessageDialog(null,"The sum is"+ sum,"sum of two integer's",JOptionPane.PLAIN_MESSAGE); }else if( OP == 2){ int sum = number1-number2; JOptionPane.showMessageDialog(null,"The difference is"+ sum,"sum of two integer's",JOptionPane.PLAIN_MESSAGE); }else if(OP == 3){ int sum = number1*number2; JOptionPane.showMessageDialog(null,"The product is"+ sum,"sum of two integer's",JOptionPane.PLAIN_MESSAGE); }else if(OP == 4){ int sum = number1 / number2; JOptionPane.showMessageDialog(null,"The quotient is"+ sum,"sum of two integer's",JOptionPane.PLAIN_MESSAGE); }else if(OP == 5){ JOptionPane.showMessageDialog(null,"PAG XURE UIE!!","HAHAHAH1!!!!!!",JOptionPane.ERROR_MESSAGE); }}
}

No comments:

Post a Comment

Like it!!!

  • songs