SHOW:
|
|
- or go back to the newest paste.
1 | using System; | |
2 | ||
3 | - | namespace P03_Calculations |
3 | + | namespace P03_Calculations { |
4 | - | { |
4 | + | class Program { |
5 | - | class Program |
5 | + | static void Main(string[] args) { |
6 | - | { |
6 | + | |
7 | - | static void Main(string[] args) |
7 | + | |
8 | - | { |
8 | + | |
9 | ||
10 | switch(command) { | |
11 | case "add": | |
12 | Console.WriteLine(Add(numOne, numTwo)); | |
13 | - | switch(command) |
13 | + | |
14 | - | { |
14 | + | |
15 | Console.WriteLine(Multiply(numOne, numTwo)); | |
16 | break; | |
17 | case "subtract": | |
18 | Console.WriteLine(Subtract(numOne, numTwo)); | |
19 | break; | |
20 | case "divide": | |
21 | Console.WriteLine(Divide(numOne, numTwo)); | |
22 | break; | |
23 | default: break; | |
24 | } | |
25 | Add(numOne, numTwo); | |
26 | Multiply(numOne, numTwo); | |
27 | Subtract(numOne, numTwo); | |
28 | Divide(numOne, numTwo); | |
29 | } | |
30 | private static int Divide(int numOne, int numTwo) { return numOne / numTwo; } | |
31 | private static int Subtract(int numOne, int numTwo) { return numOne - numTwo; } | |
32 | private static int Multiply(int numOne, int numTwo) { return numOne * numTwo; } | |
33 | private static int Add(int numOne, int numTwo) { return numOne + numTwo; } | |
34 | } | |
35 | - | private static int Divide(int numOne, int numTwo) |
35 | + |