Skip to content

Commit 34edf78

Browse files
Initial Commit
Initial Commit
1 parent 713245b commit 34edf78

8 files changed

Lines changed: 76 additions & 0 deletions

File tree

Add.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace UtilityMethods
2+
{
3+
public class AddClass
4+
{
5+
public static long Add(long i, long j)
6+
{
7+
return (i + j);
8+
}
9+
}
10+
}

Div.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace UtilityMethods
2+
{
3+
public class DivisionClass
4+
{
5+
public static long Divide(long a, long b)
6+
{
7+
return (a / b);
8+
}
9+
}
10+
}

MathLibrary.DLL

3.5 KB
Binary file not shown.

Mult.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace UtilityMethods
2+
{
3+
public class MultiplyClass
4+
{
5+
public static long Multiply(long x, long y)
6+
{
7+
return (x * y);
8+
}
9+
}
10+
}

Sub.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace UtilityMethods
2+
{
3+
public class SubtractionClass
4+
{
5+
public static long Subtract(long e, long o)
6+
{
7+
return (e - o);
8+
}
9+
}
10+
}

TestCode.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using UtilityMethods;
2+
class TestCode
3+
{
4+
static void Main(string[] args)
5+
{
6+
System.Console.WriteLine("Call methods from MathLibrary.DLL:");
7+
8+
if (args.Length != 2)
9+
{
10+
System.Console.WriteLine("Usage: TestCode <num1> <num2>");
11+
return;
12+
}
13+
14+
long num1 = long.Parse(args[0]);
15+
long num2 = long.Parse(args[1]);
16+
17+
long sum = AddClass.Add(num1, num2);
18+
long product = MultiplyClass.Multiply(num1, num2);
19+
long difference = SubtractionClass.Subtract(num1, num2);
20+
long final = DivisionClass.Divide(num1, num2);
21+
22+
System.Console.WriteLine("Addition: {0} + {1} = {2}", num1, num2, sum);
23+
24+
System.Console.WriteLine("Multiplication: {0} * {1} = {2}", num1, num2, product);
25+
26+
System.Console.WriteLine("Subtraction: {0} - {1} = {2}", num1, num2, difference);
27+
28+
System.Console.WriteLine("Division: {0} / {1} = {2}", num1, num2, final);
29+
}
30+
}

TestCode.exe

4.5 KB
Binary file not shown.

example results.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
D:\ TestCode.exe 280 90
2+
Call methods from MathLibrary.DLL:
3+
Addition: 280 + 90 = 370
4+
Multiplication: 280 * 90 = 25200
5+
Subtraction: 280 - 90 = 190
6+
Division: 280 / 90 = 3

0 commit comments

Comments
 (0)