帮我看一下,怎么改,最好说明一下原因!!谢谢!
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace _55555555555
{
class Class1:object
{
private string firstName;
private string lastName;
private string socialSecurityNumber;
private string grossSales;
private string commissionRate;
public CommissionEmployee(string first,string last,string ssn,decimal sales,decimal rate)
{
firstName =first ;
lastName =last ;
socialSecurityNumber =ssn ;
GrossSales =sales ;
CommissionRate = rate ;
}
public string FirstName
{
get
{
return firstName;
}}
public string LastName
{
get
{
return lastName;
}}
public string SocialSecurityNumber
{
get
{
return socialSecurityNumber;
}}
public decimal GrossSales;
{
get
{
return grossSales
}
set
{
if(value >=0)
grossSales=value;
else
throw new ArgumentOurOfRangeException("GroaaSales",value,"grossSales must be>=0");
}
}
public decimal CommissionRate
{
get
{
return comssionRate;
}
set
{
if (value>0 && value<1)
commissionRate =value;
else
throw new ArgumentOutOfRangeException("CommissionRate",value,"CommissionRate must be>0and<1");
}
}
public decimal Earnings()
{
return commissionrate*grossSate;
}
public override string ToString()
{
return string.Format(
"{0}:{1} {2} \n{3}:{4}\n{5}:{6:C}\n{7}:{8:F2}",
"commission employee",firstName,LastName,
"social security number",SocialSecurityNumber,
"gross sales",GrossSales,"commission rate",CommissionRate
);
}
}
class object --------------------编程问答-------------------- 抄东西都抄不明白,乱七八糟的。类名和构造函数都对不上。
这种问题懒得理,因为没必要理,不可能学明白的。 --------------------编程问答-------------------- 类名和构造函数都对不上,除了这个,还有吗? --------------------编程问答-------------------- class Class1:object 改成 class Class1:CommissionEmployee 看看
补充:.NET技术 , C#