请高手能够解释下这段程序每行的大致意思public class Test {public static void main(String[] args){Student st=new Student("张","男",123456);st.setEnglish(91);st.setMath(96);st.setComputer(98);st.Total();st.Average();System.out.print
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 02:26:31
请高手能够解释下这段程序每行的大致意思public class Test {public static void main(String[] args){Student st=new Student("张","男",123456);st.setEnglish(91);st.setMath(96);st.setComputer(98);st.Total();st.Average();System.out.print
请高手能够解释下这段程序每行的大致意思
public class Test {
public static void main(String[] args)
{
Student st=new Student("张","男",123456);
st.setEnglish(91);
st.setMath(96);
st.setComputer(98);
st.Total();
st.Average();
System.out.println("张的总成绩是:"+st.getTotal());
System.out.println("张的平均成绩是:"+st.getAverage());
Graduate gra=new Graduate("王五","男",20090201);
gra.setComputer(85);
gra.setMath(73);
gra.setEnglish(96);
gra.Total();
gra.Average();
System.out.println("王五的总成绩是:"+gra.getTotal());
System.out.println("王五的平均成绩是:"+gra.getAverage());
}
}
class Graduate extends Student{
public Graduate(String na,String s,long n) {
super(na,s,n);
}
private String major;
private String researchDirection;
private double analyzeScore;
private int analyseScore;
public void Total()
{
super.total= analyseScore+super.com_score+super.math_score;
}
public void Average()
{
super.ave=(analyseScore+super.com_score+super.math_score)/3;
}
}
class Student {
private String name;
private String sex;
private long number;
private int en_score;
protected int math_score;
protected int com_score;
protected double ave;
protected double total;
public Student(String na,String s,long n)
{
this.name=na;
this.sex=s;
this.number=n;
}
public void Total()
{
this.total=en_score+math_score+com_score;
}
public void Average()
{
this.ave=(en_score+math_score+com_score)/3;
}
public void setName(String na)
{
this.name=na;
}
public void setNumber(long nb)
{
this.number=nb;
}
public void setSex(String s)
{
this.sex=s;
}
public void setEnglish(int a)
{
this.en_score=a;
}
public void setMath(int b)
{
this.math_score=b;
}
public void setComputer(int c)
{
this.com_score=c;
}
public String getName()
{
return name;
}
public long getNumber()
{
return number;
}
public String getSex()
{
return sex;
}
public int getEnglish()
{
return en_score;
}
public int getMath()
{
return math_score;
}
public int getComputer()
{
return com_score;
}
public double getTotal()
{
return total;
}
public double getAverage()
{
return ave;
}
}
请高手能够解释下这段程序每行的大致意思public class Test {public static void main(String[] args){Student st=new Student("张","男",123456);st.setEnglish(91);st.setMath(96);st.setComputer(98);st.Total();st.Average();System.out.print
串变量赋值
查询语句是:
Select DATETIME,VALUE,TAG FROM client WHERE MODE = 'AVERAGE' and (TAG=(Tag1的值) or TAG=(Tag2的值)or TAG=(Tag3的值)or TAG=(Tag4的值)or TAG=(Tag5的值)or TAG=(Tag6的值)or TAG=(Tag7的值)or TAG=(Tag8的值))and INTERVAL = '01:00:00' and (DATETIME >= (StartTime的值) and DATETIME <= (EndTime的值))
从 client 选择 DATETIME,VALUE,TAG 字段中的数据
数据符合条件是:当 MODE 等于'AVERAGE' 并且 (TAG必须等于Tag1至Tag8的其中一个变量的值)并且 INTERVAL 等于 '01:00:00' 并且 DATETIME 的取值范围介于StartTime,EndTime 之间(包括StartTime,EndTime)
其中 :
为 字符串转成sql中相对的datetime类型.ts很少使用.记得不是很准确了.
以上也是个人判断,不一定正确.
用这个function 就能知道一月多少天.
Public Function DaysOfMonth(aYear As Integer,aMonth As Integer) As Integer
Dim i As Integer
For i = 31 To 28 Step -1
If IsDate(CStr(aYear) & "-" & CStr(aMonth) & "-" & i) Then
DaysOfMonth = i
Exit Function
End If
Next
End Function
然后取个月初加上这个函数返回值-1就是月末.这样每月30天31天29天28天都可以了.
另外,团IDC网上有许多产品团购,便宜有口碑