The question is Create a class called Calculator which contains methods for arithmetic operations such as Addition, Subtraction ,Multiplication and Division. Division method should return the Quotient and Remainder(hint:use out parameter).
Follow the method signatures as given below:
public int Addition(int a, int b)
public int Subtraction(int a, int b)
public int Multiplication(int a, int b)
public double Division(int a, int b, out double remainder). //The method should return the Quotient and Remainder should be passed through the out parameter.
The methods should return the appropriate result.
Create a class Program with Main Method . Prompt for 2 operands and operator from the user, Call the appropriate method for operation and display the results.
Note:
Don't create any new namespace.
Create classes with pubic access specifier
Sample Input
Enter the operator
+
Enter the operands
12
10
Sample Output
Result of 12 + 10 is 22
Sample Input
Enter the operator
/
Enter the operands
11
2
Sample Output
Result of 11 / 2 is 5
Remainder =1
Sample Input
Enter the operator
&
Enter the operands
12
10
Sample Output
Invalid Operator
Answers
Answered by
3
Answer:
you should send pictures of this question not typing
Similar questions