我必须使用枚举器将传递给构造函数的浮点数转换为基于浮点数(称为 R)的字符串。它看起来像这样:
static void Main(string[] args)
{
float R = 1;
<name of class> <object> = new <name of class> (R);
}
public class <name of class>
{
enum <name of enum> {value1 = 1, value2 = 2, value3 = 3}
float storeR;
public <name of class>(float R)
{
storeR = R;
}
}
我该怎么做呢?我应该将枚举放在其他地方吗?