Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Methods
- {
- class Program
- {
- static void Main(string[] args)
- string command = Console.ReadLine();
- double a = double.Parse(Console.ReadLine());
- double b = double.Parse(Console.ReadLine());
- switch (command)
- { case "add":
- Add(a, b);
- break;
- case "multipy":
- multiply(a, b);
- break;
- case "divide":
- divide(a, b);
- break;
- case "subtract":
- sub(a, b);
- break;
- }
- }
- static void sub(double a, double b)
- {
- Console.WriteLine(a-b);
- }
- static void divide(double a, double b)
- {
- Console.WriteLine(a/b);
- }
- static void multiply(double a, double b)
- {
- Console.WriteLine(a*b);
- }
- static void Add(double a, double b)
- {
- Console.WriteLine(a+b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement