Anda di halaman 1dari 6

PROJECT

class program { void main (int a, int b, int c) { float base ,float index ,double power ,double sqrt ; Input stream reader obj = new buffered Reader (obj) ; System . out . print ln (welcome to perform the calculations) ; System . out . print ln (press 1 for addition) ; System . out . print ln (press 2 for multiplication) ; System . out . print ln (press 3 for division) ; System . out .print ln (press 4 for subtraction) ; System . out .print ln (press 5 for modulas) ; System . out .print ln (press 6 for power) ; System . out .print ln (press 7 for square root) ; System . out .print ln (press 8 for value of sin) ; System . out .print ln (press 9 for value of cos) ; System . out .print ln (press 10 for value of tan) ; char ch ; Char ch= obj read line ( ) ; if (ch==1) { System . out . print ln(enter first number) ;

int a = obj BR. Read line ( ) ; A = integer . parse int (a) ; System . out. println (enter second number) ; Int b=obj BR.. read line ( ) ; b= integer .parse int (b) ; System . out . print ln(\f) ; c= a+b ; System .out . print in (sum of +a+ and +b+ is :+sum) ; } If (ch==2) { System . out . print ln (enter the third number) ; Int a= obj BR . read line ( ) ; a= integer parse int (a) ; System . out . print in (enter the other number) ; Int b= obj BR.. read line ( ) ; b= integer parse int (b) ; System . out . print ln(\f) ; c=a*b ; System. Out. Print in ( product of + a+ and +b+ is: product ); { If( ch= = 3) } System . out print in( enter the other number ); Int a = obj . BR . read line ( );

a = integer parse Int (a) ; System . out . print ln ( enter the other number ); Int b = obj BR . read line ( ); B = integer parse int (b) ; System . out . print in (b) ; C = a/b ; System . out . print ln ( division of + a + and + b is : division ); } If ( ch = =4 ) { System.out.println( enter the other number ); Int a = obj BR . read line ( ) ; a = integer parse int (a) ; System.out.println (enter the other number) ; Int b= obj BR . read line ( ) ; B = integer parse int (b) ; System.outprintln (f ) ; c = a-b ; System.out.println ( subtraction of + a+ and + b is : subtraction ); } If (ch = = 5) { System.out.println(enter the other number ) ; Int a= obj BR .read line (a) ; A=integer parse int (a) ;

System.out.println ( enter the other number ) Int b = obj BR. . read line ( ) ; B = interger parse int (b) ; System.out.println (f ) ; C=a %b Ystem.out.println ( modulas of + a +and + b is :modulas) } If (ch = = 6) { System.out.println (enter the base value) ; Intb = obj BR . read line ( ) ; Base = integer . parse int (b) ; Sopln (enter the index value) ; Int I =obj BR . read line ( ) ; Index = integer . parse int ( i) ; Power = math . pow ( bass , index ) ; System.out.println (\f) ; System.out.println (base is : + base ) ; System.out,println (index is : + index) ; System.out.printn(power value is : +power) ; } If (ch = =7) { Sustem.out.println (enter the number) ; Int a = obj BR . read line ( );

A = integer . parse int (a) ; System.out.println (enter the . another number ) ; Int b = obj BR . red line ( ) ; B = integer . parse int (b) ; Sqrt = math . Sqrt (a,b) System.out.println (/f) ; System.out.println (Sqrt of+a+and+b is: sqrt) ; } If (ch==8) { Sustem . out . print ln (enter the angle of radian) Float a= obj BR.. read line ( ); A= integer . parse int (a) ; Sin = math . sin (a) ; System . out . print ln ( sin value is : +sin) ; } If (ch==9) { System . out . print ln (enter the angle of radian) ; Float a = obj. BR read line ( ) ; A= intger . parse int (a) ; Cos = math . cos (a) ; System . out . print ln (cos value is :+ cos) ; } If (ch==10)

{ System . out .print ln (enter the angle of radian) ; Float a = obj. BR read line ( ) ; A = integer . parse int (a) ; Tan = math . tan (a) ; System . out . print ln (tan value is : + tan) ; } Default : System . out . print ln (please enter the number between 1 and 10) ; } } }

Anda mungkin juga menyukai