Arithmetic operations

Report a typo

Write a class named ArithmeticOperations containing two properties: an Int property x and an Int property y.

Add the following member functions to the class:

  • addition – adds x to y;

  • subtraction – subtracts y from x;

  • multiplication – multiplies x by y;

  • division – divides x by y.

Each function returns an integer result of the operation.

You can be assured that there will be no zero division. Additionally, all operations should be performed with integer operands only.

Write a program in Kotlin
// write your class here
___

Create a free account to access the full topic