score在java中是什么意思_java:定义学⽣类Student,其中属
性有name,。。。
展开全部
定义⼀个表⽰学⽣信息的类Student,要求如下:
(1)类Student的成员变量:
sNO 表⽰学号;sName表⽰姓62616964757a686964616fe59b9ee7ad9431333365643637名;sSex表⽰性别;sAge表⽰年龄;sJava:表⽰Java课程成绩。
(2)类Student带参数的构造⽅法:
在构造⽅法中通过形参完成对成员变量的赋值操作。
一壶老酒歌词
(3)类Student的⽅法成员:
getNo():获得学号;
getName():获得姓名;
getSex():获得性别;
getAge()获得年龄;
getJava():获得Java 课程成绩
(4)根据类Student的定义,创建五个该类的对象,输出每个学⽣的信息,计算并输出这五个学⽣Java语⾔成绩的平均值,以及计算并输出他们Java语⾔成绩的最⼤值和最⼩值。*/
class student{
String sNO,sName,sSex;
int sAge;
double sJava;
public student(String a,String b,String c,int d ,double e){
sNO=a;
sName=b;
sSex=c;
sAge=d;
sJava=e;}
全脑思维String getNo(){
return sNO;}
String getName(){
return sName;}
String getSex(){
return sSex;}
手机变砖int getAge(){
return sAge;}
double getJava(){
return sJava;}
void show(){
System.out.println("姓名:"+getName());
System.out.println("学号:"+getNo());
System.out.println("性别:"+getSex());
System.out.println("年龄:"+getAge());
System.out.println("Java成绩:"+getJava());}
}
public class chengji{
public static void main(String[] args){
double avrage,K1,K2,K3,K4,K5;
student A1=new student("13190310","李⼀","男",18,80); student A2=new student("13190311","刘⼆","⼥",19,83); student A3=new student("13190312","张三","男",19,82); student A4=new student("13190313","杨四","⼥",20,88); student A5=new student("13190314","韩舞","⼥",20,90); A1.show();
System.out.println();
A2.show();
System.out.println();
A3.show();
System.out.println();夸女生的四字词语
A4.show();
System.out.println();
A5.show();
System.out.println();
Java();
Java();
Java();
Java();
Java();
avrage=(K1+K2+K4+K3+K5)/5;
System.out.println("Java平均成绩:"+avrage); double a[]={K1,K2,K3,K4,K5};
double max=0,min=0,ck;
for(int i=0;i<4;i++){
台湾卤肉max=K1;
if(max
ck=max;
max=a[i+1];
a[i+1]=ck;}}
System.out.println("Java的最⾼分为:"+max); for(int i=0;i<4;i++){
max=K1;
if(min>a[i+1]){
ck=min;
min=a[i+1];
a[i+1]=ck;}小炒牛肉的家常做法
凉拌马齿苋}
五年级下册知识点System.out.println("Java的最低分为:"+max); }
}