Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Kata
- {
- public static double Calculator(double a, double b, char op)
- {
- double x = a;
- double y = b;
- char user = op;
- double result = 0;
- if(user == "+")
- {
- result = x + y;
- return result;
- }
- else
- if(user == "-")
- {
- result = x - y;
- return result;
- }
- else
- if (user == "*")
- {
- result = x * y;
- return result;
- }
- else
- if (user == "/")
- {result = x / y;
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement