I note that your code wouldn't compile in VBA, and isn't even logical. So my sample below is a guess... You really have to take more care when asking questions here.
NB: .NET being a modern language (unlike VBA), it is object oriented to the core and doesn't include the concept of global variables of functions, like are so often used in VBA programming. This goes for C# as for VB.NET.
In .NET all your code is is packaged into classes (OK, structs and enums too), as opposed to modules.
However, VBA Standard Modules will translate to static classes in .NET. So, to get yourself started, you can do that. But on the whole it is bad design. Or rather, a good way to design bugs.
With this caveat, you can do something along the lines of:
namespace MyMultivaluedUniverse
{
// As these classes are static, all methods and properties need to be static too.
public static class MyUniverse
{
public static double A { get; set; } // shortcut notation for properties .NET 2+
public static double B { get; set; }
public static double Add() // If you are just adding your Properties A and B, no need for this method to have parameters
{
return A + B;
}
}
public static class MyWorld
{
public static double E { get; set; }
public static double Subtract(double D)
{
E = D - MyUniverse.Add(); // Note how I specify the class name before the method: this works only for static methods
return E;
}
}
// This class is not static, so doesn't need static everywhere
public class MyHome
{
public double Arithmetic(double F)
{
return MyUniverse.Add() - MyWorld.Subtract(F); // will trivially equal F
}
}
public class MySelf
{
MyHome mh = new MyHome(); // shows how to instantiate a non static class and use it
public double DoWork(double G)
{
return mh.Arithmetic(G); // I precede the method name with the Instance name.
}
}
}