import java.util.Scanner;

class Addition  // SubClass

{

void add(int x,int y)

{

System.out.println("Sum:"+(x+y));

}  

}

class Subtraction  // SubClass

{

void sub(int x,int y)

{

System.out.println("Sub:"+(x-y));

}

}

class Multiplication  //SubClass

{

void multi(int x,int y)

{

System.out.println("Multi:"+(x*y));

}

}

class Division  //SubClass

{

void div(int x,int y)

{

System.out.println("div:"+(float)x/y);

}

}

class ModDivision  //SubClass

{

void ModDiv(int x,int y)

{

System.out.println("ModDiv:"+(x%y));

}

}

class ArithmeticMainClass   //MainClass

{

    public static void main(String[] args) 

    {

Scanner s=new Scanner(System.in);

System.out.println("Enter the int Value1:");

int v1=s.nextInt();

System.out.println("Enter the int Value2:");

int v2=s.nextInt();

System.out.println("=======Choice=======");

System.out.println("1.add\n2.sub\n3.multi\n4.div\n5.modDiv");

System.out.println("Enter the Choice:");

int choice=s.nextInt();

switch(choice)

{

case 1:

Addition ad=new Addition();

ad.add(v1,v2);

break;


case 2:

Subtraction sb=new Subtraction();

sb.sub(v1,v2);

break;


case 3:

Multiplication ml=new Multiplication();

ml.multi(v1,v2);

break;


case 4:

Division dv=new Division();

dv.div(v1,v2);

break;


case 5:

ModDivision md=new ModDivision();

md.ModDiv(v1,v2);

break;


default:

System.out.println("Invalid Choice....");

        } // End of Switch Case

  }

        }

OUTPUT:-

Enter the int Value1:
5
Enter the int Value2:
9
=======Choice=======
1.add
2.sub
3.multi
4.div
5.modDiv
Enter the Choice:
1
Sum:14

D:\Core java>java ArithmeticMainClass
Enter the int Value1:
15
Enter the int Value2:
5
=======Choice=======
1.add
2.sub
3.multi
4.div
5.modDiv
Enter the Choice:
2
Sub:10

D:\Core java>java ArithmeticMainClass
Enter the int Value1:
8
Enter the int Value2:
2
=======Choice=======
1.add
2.sub
3.multi
4.div
5.modDiv
Enter the Choice:
3
Multi:16

D:\Core java>java ArithmeticMainClass
Enter the int Value1:
12
Enter the int Value2:
4
=======Choice=======
1.add
2.sub
3.multi
4.div
5.modDiv
Enter the Choice:
4
div:3.0

D:\Core java>java ArithmeticMainClass
Enter the int Value1:
12
Enter the int Value2:
5
=======Choice=======
1.add
2.sub
3.multi
4.div
5.modDiv
Enter the Choice:
5
ModDiv:2