using system;
public class employee
{ public string name;
public string alies;
public string salary=3000.00cm;
//构找函数;
public enployee(string name ,string alias)
{ this.name =name;
this .alias=alias;
}
//打应的方法
public void printemployee()
{ console.writeline("name:{0} \n Alias:{1}",name,alias);
//使用this关键字将对象传递给calctax方法
console.writeline("taxes:{0:c}",tax,calctax(this));
}
public class tax
{ public static decimal calctax(employee E)
{
return(0.08m*(E.salary));
}
}
public class mainclass
{ public static void main()
{ file://创建对象
employee E1= new employee ("John M.Trainer","jtrainer");
//显示结果
E1.printemployee();
}
}
请写出它的输出结果。
答案一星期后给出,望大家懂脑筋想一想,静观大家的看法
[此贴子已经被作者于2004-05-17 14:43:34编辑过]