herrDeng網內搜尋

自訂搜尋

Ads

2013年6月11日 星期二

作業

5筆學生分數資料
"學生1", 60
"學生2", 87
"學生3", 47
"學生4", 50
"學生5", 66
  1. 請寫出函數(Java中的類別方法)列出分數最高者的姓名,
  2. 請寫出函數(Java中的類別方法)算出這五個學生的平均分數,
  3. 請寫出函數(Java中的類別方法)列出當中不及格者的資料。

53 則留言:

b9833154徐瑋侖 提到...


public class student {
String name ;
int score;
public student (String x, int y){
name = x;
score = y;

}

public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);

}

}

public class ex1 {



public static void main(String[] args) {
student[] X = new student[5];
X[0]= new student ("學生1", 60);
X[1]= new student ("學生2", 87);
X[2]= new student ("學生3", 47);
X[3]= new student ("學生4", 50);
X[4]= new student ("學生5", 66);
for(int i=0; i<X.length; i++)
X[i].printData();
int a =0;
for(int i=0 ; i<5; i++)
a+=X[i].score;
System.out.println("av="+a/5);

for(int i=0 ; i<5; i++)
if(X[i].score<60)
System.out.println("不及格="+X[i].name);

int c = 0 ;
for(int b=0 ; b<5; b++){

if (X[b].score >c)
c = X[b].score;

}System.out.println("最高分="+c);


}
}

B9933122 苑珮婕 提到...

public class student1 {
String name;
int score;

public student1(String name, int score) {
super();
this.name = name;
this.score = score;
}
public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);
}
}

public class student2 {
public static double average(student1[]x){
double f=0;
for (int i=0; i<x.length;i++)
f+=(double)x[i].score;
return f/x.length;
}
public static void main(String[] args) {
student1 []x=new student1[5];
x[0]=new student1("學生1",60);
x[1]=new student1("學生2",87);
x[2]=new student1("學生3",47);
x[3]=new student1("學生4",50);
x[4]=new student1("學生5",66);
for (int i=0;i<x.length;i++)
x[i].printData();
System.out.println("average="+average(x));
}
}

B10036036陸語萱 提到...

public class student {
String name;
int score;

public student(String name, int score) {
this.name = name;
this.score = score;
}
public void printDate(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);
}
}


public class stdEx {
public static double average(student[]x){
double f=0;
for(int i=0;i<x.length;i++)
f+=(double)x[i].score;
return f/x.length;
}
public static void main(String[] args){
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);
for (int i=0;i<x.length;i++)
x[i].printDate();
System.out.println("average="+average(x));
}
}

B9933179陳俊翰 提到...

public class stdEX {

public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);

student max=x[0];
for(int j=0;j<x.length;j++){
if (x[j].score>max.score)
max=x[j];
}System.out.println("最高分:"+max.name);

int sum=0;
for(int j=0;j<x.length;j++){
sum+=x[j].score;
}System.out.println("平均="+sum/x.length);

for(int k=0;k<x.length;k++){
if (x[k].score<60.0){
System.out.print("不及格者:");
x[k].printdata();
}
}
}
}

B10133009 王韋翔 提到...

public class xx {
String name;
int number;
double av;
public xx(String x, int y) {

name = x;
number = y;


}
public void printData(){
System.out.print("name"+name+"\t");
System.out.println("number="+number);

}
}


---------------------------------------------


public class aa {
public static void prMax(xx a[]){
int nu=a[0].number;
String Max;
for(int i=1;i<a.length;i++)
if(nu<a[i].number){
nu=a[i].number;
Max=a[i].name;
System.out.print("分數最高的學生為"+Max);
}

}
public static void main(String[] args){
double av=0;
xx a[]=new xx[5];
a[0]=new xx("學生1", 60);
a[1]=new xx("學生2", 87);
a[2]=new xx("學生3", 47);
a[3]=new xx("學生4", 50);
a[4]=new xx("學生5", 66);

for(int i=0;i<a.length;i++){
a[i].printData();
av+=a[i].number;

} prMax(a);
}
}

b10133025王柏文 提到...

public class xx { String name; int number; double av; public xx(String x, int y) { name = x; number = y; } public void printData(){ System.out.print("name"+name+"\t"); System.out.println("number="+number); }}---------------------------------------------public class aa { public static void prMax(xx a[]){ int nu=a[0].number; String Max; for(int i=1;i<a.length;i++) if(nu<a[i].number){ nu=a[i].number; Max=a[i].name; System.out.print("分數最高的學生為"+Max); } } public static void main(String[] args){ double av=0; xx a[]=new xx[5]; a[0]=new xx("學生1", 60); a[1]=new xx("學生2", 87); a[2]=new xx("學生3", 47); a[3]=new xx("學生4", 50); a[4]=new xx("學生5", 66); for(int i=0;i<a.length;i++){ a[i].printData(); av+=a[i].number; } prMax(a); }}.

B10133013林子恩 提到...

public class hh {
String name;
int number;
double av;
public xx(String x, int y) {

name = x;
number = y;


}
public void printData(){
System.out.print("name"+name+"\t");
System.out.println("number="+number);

}
}

---------------------------------------------

public class cc {
public static void prMax(xx a[]){
int nu=a[0].number;
String Max;
for(int i=1;i<a.length;i++)
if(nu<a[i].number){
nu=a[i].number;
Max=a[i].name;
System.out.print("分數最高的學生為"+Max);
}

}
public static void main(String[] args){
double av=0;
xx a[]=new xx[5];
a[0]=new xx("學生1", 60);
a[1]=new xx("學生2", 87);
a[2]=new xx("學生3", 47);
a[3]=new xx("學生4", 50);
a[4]=new xx("學生5", 66);

for(int i=0;i<a.length;i++){
a[i].printData();
av+=a[i].number;

} prMax(a);
}
}

b10133051張丞緯 提到...

public class xx {
String name;
int number;
double av;
public xx(String x, int y) {

name = x;
number = y;


}
public void printData(){
System.out.print("name"+name+"\t");
System.out.println("number="+number);

}
}


---------------------------------------------


public class aa {
public static void prMax(xx a[]){
int nu=a[0].number;
String Max;
for(int i=1;i<a.length;i++)
if(nu<a[i].number){
nu=a[i].number;
Max=a[i].name;
System.out.print("分數最高的學生為"+Max);
}

}
public static void main(String[] args){
double av=0;
xx a[]=new xx[5];
a[0]=new xx("學生1", 60);
a[1]=new xx("學生2", 87);
a[2]=new xx("學生3", 47);
a[3]=new xx("學生4", 50);
a[4]=new xx("學生5", 66);

for(int i=0;i<a.length;i++){
a[i].printData();
av+=a[i].number;

} prMax(a);
}
}

B10133048饒家華 提到...

public class student {
String name;
int level;
public student(String x, int y) {
name = x;
level = y;
}
public void prData(){
System.out.println("name:"+name);
System.out.println("level:"+level);
}
}

public class student1 {
public static void prMax(student x[]){
student Max=x[0];
for(int i=0; i<x.length; i++)
if(x[i].level>Max.level)
Max=x[i];
System.out.println(Max.name);
}
public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87) ;
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);
prMax(x);
}

}

b10133045林玹安 提到...

public class apple{
String name;
int scroe;
public apple(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new apple("學生1", 60);
x[1]= new apple("學生2", 87);
x[2]= new apple("學生3", 47);
x[3]= new apple("學生4", 50);
x[4]= new apple("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分姓名:"+x[m].name);
System.out.println("最高分:"+a);
}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}

b10133023徐顥 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分:"+x[m].name);

}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}

b10133016王致翔 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int o=0; o<x.length; o++){
if(a==x[o].scroe){
System.out.println("最高分:"+x[o].name);

}
}
System.out.println("平均:"+b/x.length);
for(int p=0; p<x.length; p++)
if(x[p].scroe<60){
System.out.println("不及格姓名:"+x[p].name);
System.out.println("不及格分數:"+x[p].scroe);
}
}
}

B9833091陳孟偉 提到...

public class aaaaa {
String name;
int score;

public aaaaa(String name, int score) {
super();
this.name = name;
this.score = score;
}
public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);
}
}
---------------------------
public class bbbbb {
public static double average(student1[]x){
double f=0;
for (int i=0; i<x.length;i++)
f+=(double)x[i].score;
return f/x.length;
}
public static void main(String[] args) {
student1 []x=new student1[5];
x[0]=new student1("學生1",60);
x[1]=new student1("學生2",87);
x[2]=new student1("學生3",47);
x[3]=new student1("學生4",50);
x[4]=new student1("學生5",66);
for (int i=0;i<x.length;i++)
x[i].printData();
System.out.println("average="+average(x));
}
}

B10133046邱誌寬 提到...

class sor2{

public static void prmm(sor x[]){
sor Max=x[0];
for(int i=0;i<x.length;i++){
if(Max.jj<x[i].jj)
Max=x[i];
}
System.out.println(Max.kk);
}
public static void prav(sor x[]){
int av=0;
for(int i=0;i<x.length;i++){
av+=x[i].jj;

}
System.out.println((double)av/x.length);
}
public static void prlk(sor x[]){
for(int i=0;i<x.length;i++){
if(60>x[i].jj)
System.out.print(x[i].kk+"\t"+x[i].jj+"\n");
}

}
public static void main(String[]args){
sor x[]=new sor[5];
x[0]=new sor("學生1",60);
x[1]=new sor("學生2",87);
x[2]=new sor("學生3",47);
x[3]=new sor("學生4",50);
x[4]=new sor("學生5",66);
prmm(x);
prav(x);
prlk(x);
}
}

B10133047 鄭兆珊 提到...


public class student {
String name;
int score;

public student(String x, int y){
name=x;
score=y;
}

public void printData(){
System.out.print("Name:"+name);
System.out.print("\tScore"+score);
}
}

public class ss {
public static void main(String[] args){
student X[]=new student[3];
X[0]=new student("學生1",60);
X[1]=new student("學生2",87);
X[2]=new student("學生3",47);
X[3]=new student("學生4",50);
X[4]=new student("學生5",66);

for (int i=0;i<X.length;i++)
X[i].printData();

int a=0;
for (int i=0 ; i<5; i++)
a+=X[i].score;
System.out.println("av="+a/5);

for (int i=0 ; i<5; i++)
if(X[i].score<60)
System.out.println("不及格="+X[i].name);
int c = 0 ;
for(int b=0 ; b<5; b++){
if (X[b].score >c)
c = X[b].score;
}System.out.println("最高分="+c);



}
}

B10133048饒家華 提到...

public class student1 {
public static void av(student x[]){
double av=0;
for(int i=0;i<x.length;i++){
av+=x[i].level;
}
System.out.println(av/5);
}
public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);
av(x);
}

}

10133048饒家華 提到...

public class student1 {
public static void av(student x[]){
double av=0;
for(int i=0;i<x.length;i++){
if(60<x[i].level)
System.out.println(x[i].name+"\t"+x[i].level+"\n");
}
}
public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);
av(x);
}

}

b10133032黃徐琨 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int o=0; o<x.length; o++){
if(a==x[o].scroe){
System.out.println("最高分:"+x[o].name);

}
}
System.out.println("平均:"+b/x.length);
for(int p=0; p<x.length; p++)
if(x[p].scroe<60){
System.out.println("不及格姓名:"+x[p].name);
System.out.println("不及格分數:"+x[p].scroe);
}
}
}

B10133050張珈祥 提到...

public class one {



public static void main(String[] args) {
student[] X = new student[5];
X[0]= new student ("學生1", 60);
X[1]= new student ("學生2", 87);
X[2]= new student ("學生3", 47);
X[3]= new student ("學生4", 50);
X[4]= new student ("學生5", 66);
for(int i=0; i<X.length; i++)
X[i].printData();
int a =0;
for(int i=0 ; i<5; i++)
a+=X[i].score;
System.out.println("av="+a/5);

for(int i=0 ; i<5; i++)
if(X[i].score<60)
System.out.println("不及格="+X[i].name);

int c = 0 ;
for(int b=0 ; b<5; b++){

if (X[b].score >c)
c = X[b].score;

}System.out.println("最高分="+c);

}
}

B10133003王冠文 提到...

public class test{
String name;
int scroe;
public test(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
test x[] = new apple[5];
x[0]= new test("學生1", 60);
x[1]= new test("學生2", 87);
x[2]= new test("學生3", 47);
x[3]= new test("學生4", 50);
x[4]= new test("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分姓名:"+x[m].name);
System.out.println("最高分:"+a);
}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}

B10133015楊超文 提到...

public class xx {
String name;
int number;
double av;
public xx(String x, int y) {

name = x;
number = y;


}
public void printData(){
System.out.print("name"+name+"\t");
System.out.println("number="+number);

}
}


---------------------------------------------


public class aa {
public static void prMax(xx a[]){
int nu=a[0].number;
String Max;
for(int i=1;i<a.length;i++)
if(nu<a[i].number){
nu=a[i].number;
Max=a[i].name;
System.out.print("分數最高的學生為"+Max);
}

}
public static void main(String[] args){
double av=0;
xx a[]=new xx[5];
a[0]=new xx("學生1", 60);
a[1]=new xx("學生2", 87);
a[2]=new xx("學生3", 47);
a[3]=new xx("學生4", 50);
a[4]=new xx("學生5", 66);

for(int i=0;i<a.length;i++){
a[i].printData();
av+=a[i].number;

} prMax(a);
}
}


B10133044吳盛盟 提到...

public class app{
String name;
int scroe;
public app(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
app x[] = new apple[5];
x[0]= new app("學生1", 60);
x[1]= new app("學生2", 87);
x[2]= new app("學生3", 47);
x[3]= new app("學生4", 50);
x[4]= new app("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分姓名:"+x[m].name);
System.out.println("最高分:"+a);
}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}

B10133027黃為邦 提到...

public class xx {
String name;
int number;
double av;
public xx(String x, int y) {

name = x;
number = y;


}
public void printData(){
System.out.print("name"+name+"\t");
System.out.println("number="+number);

}
}


---------------------------------------------


public class aa {
public static void prMax(xx a[]){
int nu=a[0].number;
String Max;
for(int i=1;i<a.length;i++)
if(nu<a[i].number){
nu=a[i].number;
Max=a[i].name;
System.out.print("分數最高的學生為"+Max);
}

}
public static void main(String[] args){
double av=0;
xx a[]=new xx[5];
a[0]=new xx("學生1", 60);
a[1]=new xx("學生2", 87);
a[2]=new xx("學生3", 47);
a[3]=new xx("學生4", 50);
a[4]=new xx("學生5", 66);

for(int i=0;i<a.length;i++){
a[i].printData();
av+=a[i].number;

} prMax(a);
}
}


B10133005 李沛澤 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分:"+x[m].name);

}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}

b10133021吳屹軒 提到...

public class tostudent{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int o=0; o<x.length; o++){
if(a==x[o].scroe){
System.out.println("最高分:"+x[o].name);

}
}
System.out.println("平均:"+b/x.length);
for(int p=0; p<x.length; p++)
if(x[p].scroe<60){
System.out.println("不及格的姓名:"+x[p].name);
System.out.println("不及格的分數:"+x[p].scroe);
}
}
}


B10133005李沛澤 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分:"+x[m].name);

}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}

B10133030林潔如 提到...

public class student {
String name;
int score;

public student(String name, int score) {
this.name = name;
this.score = score;
}
public void printDate(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);
}
}


public class stdEx {
public static double average(student[]x){
double f=0;
for(int i=0;i<x.length;i++)
f+=(double)x[i].score;
return f/x.length;
}
public static void main(String[] args){
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);
for (int i=0;i<x.length;i++)
x[i].printDate();
System.out.println("average="+average(x));
}
}

B10133018翁湘姿 提到...

public class student {
String name;
int level;
public student(String x, int y) {
name = x;
level = y;
}
public void prData(){
System.out.println("name:"+name);
System.out.println("level:"+level);
}
}

public class student1 {
public static void prMax(student x[]){
student Max=x[0];
for(int i=0; i<x.length; i++)
if(x[i].level>Max.level)
Max=x[i];
System.out.println(Max.name);
}
public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87) ;
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);
prMax(x);
}

}

B10133031 邱敏惠 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int o=0; o<x.length; o++){
if(a==x[o].scroe){
System.out.println("最高分:"+x[o].name);

}
}
System.out.println("平均:"+b/x.length);
for(int p=0; p<x.length; p++)
if(x[p].scroe<60){
System.out.println("不及格姓名:"+x[p].name);
System.out.println("不及格分數:"+x[p].scroe);
}
}
}

B10133005李沛澤 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分:"+x[m].name);

}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}

B10133011 黃怡蓁 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int o=0; o<x.length; o++){
if(a==x[o].scroe){
System.out.println("最高分:"+x[o].name);

}
}
System.out.println("平均:"+b/x.length);
for(int p=0; p<x.length; p++)
if(x[p].scroe<60){
System.out.println("不及格姓名:"+x[p].name);
System.out.println("不及格分數:"+x[p].scroe);
}
}
}

B10133038池侑承 提到...

public class student {
String name;
int level;
public student(String x, int y) {
name = x;
level = y;
}
public void prData(){
System.out.println("name:"+name);
System.out.println("level:"+level);
}
}

public class student1 {
public static void prMax(student x[]){
student Max=x[0];
for(int i=0; iMax.level)
Max=x[i];
System.out.println(Max.name);
}
public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87) ;
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);
prMax(x);
}

}

B9833102曾冠誌 提到...

public class student1 {
String name;
int score;

public student1(String name, int score) {
super();
this.name = name;
this.score = score;
}
public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);
}
}

public class student2 {
public static double average(student1[]x){
double f=0;
for (int i=0; i<x.length;i++)
f+=(double)x[i].score;
return f/x.length;
}
public static void main(String[] args) {
student1 []x=new student1[5];
x[0]=new student1("學生1",60);
x[1]=new student1("學生2",87);
x[2]=new student1("學生3",47);
x[3]=new student1("學生4",50);
x[4]=new student1("學生5",66);
for (int i=0;i<x.length;i++)
x[i].printData();
System.out.println("average="+average(x));
}
}

B10133042沈俞宜 提到...

public class xx {
String name;
int number;
double av;
public xx(String x, int y) {

name = x;
number = y;


}
public void printData(){
System.out.print("name"+name+"\t");
System.out.println("number="+number);

}
}


---------------------------------------------


public class aa {
public static void prMax(xx a[]){
int nu=a[0].number;
String Max;
for(int i=1;i<a.length;i++)
if(nu<a[i].number){
nu=a[i].number;
Max=a[i].name;
System.out.print("分數最高的學生為"+Max);
}

}
public static void main(String[] args){
double av=0;
xx a[]=new xx[5];
a[0]=new xx("學生1", 60);
a[1]=new xx("學生2", 87);
a[2]=new xx("學生3", 47);
a[3]=new xx("學生4", 50);
a[4]=new xx("學生5", 66);

for(int i=0;i<a.length;i++){
a[i].printData();
av+=a[i].number;

} prMax(a);
}
}


B10133014 吳欣怡 提到...

public class stdEX {

public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);

student max=x[0];
for(int j=0;j<x.length;j++){
if (x[j].score>max.score)
max=x[j];
}System.out.println("最高分:"+max.name);

int sum=0;
for(int j=0;j<x.length;j++){
sum+=x[j].score;
}System.out.println("平均="+sum/x.length);
}
}

B10133040溫翊惠 提到...


public class student {
String name ;
int score;
public student (String x, int y){
name = x;
score = y;

}

public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);

}

}

public class ex1 {



public static void main(String[] args) {
student[] X = new student[5];
X[0]= new student ("學生1", 60);
X[1]= new student ("學生2", 87);
X[2]= new student ("學生3", 47);
X[3]= new student ("學生4", 50);
X[4]= new student ("學生5", 66);
for(int i=0; i<X.length; i++)
X[i].printData();
int a =0;
for(int i=0 ; i<5; i++)
a+=X[i].score;
System.out.println("av="+a/5);

for(int i=0 ; i<5; i++)
if(X[i].score<60)
System.out.println("不及格="+X[i].name);

int c = 0 ;
for(int b=0 ; b<5; b++){

if (X[b].score >c)
c = X[b].score;

}System.out.println("最高分="+c);


}
}


B10133053古聿穎 提到...

public class student {
String name ;
int score;
public student (String x, int y){
name = x;
score = y;

}

public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);

}

}

public class ex1 {


B10133002 謝佩紋 提到...

public class student {
String name;
int score;

public student(String x, int y){
name=x;
score=y;
}

public void printData(){
System.out.print("Name:"+name);
System.out.print("\tScore"+score);
}
}

B10133053古聿穎 提到...

public class student {
String name ;
int score;
public student (String x, int y){
name = x;
score = y;

}

public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);

}

}

public class ex1 {


B10133002 謝佩紋 提到...

public class stdEX {

public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);

student max=x[0];
for(int j=0;jmax.score)
max=x[j];
}System.out.println("最高分:"+max.name);

int sum=0;
for(int j=0;j<x.length;j++){
sum+=x[j].score;
}System.out.println("平均="+sum/x.length);
}
}

B10133033呂之筠 提到...

public class hello {

public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);

student max=x[0];
for(int j=0;jmax.score)
max=x[j];
}System.out.println("最高分:"+max.name);

int sum=0;
for(int j=0;j<x.length;j++){
sum+=x[j].score;
}System.out.println("平均="+sum/x.length);

for(int k=0;k<x.length;k++){
if (x[k].score<60.0){
System.out.print("不及格者:");
x[k].printdata();
}
}
}
}

B10133003王冠文 提到...

public class test{
String name;
int scroe;
public test(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
test x[] = new test[5];
x[0]= new test("學生1", 60);
x[1]= new test("學生2", 87);
x[2]= new test("學生3", 47);
x[3]= new test("學生4", 50);
x[4]= new test("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分姓名:"+x[m].name);
System.out.println("最高分:"+a);
}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}



b9933180陳威羽 提到...

public class stdEX {

public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);

student max=x[0];
for(int i=0;i<x.length;i++){
if (x[i].score>max.score)
max=x[i];
}System.out.println("最高分:"+max.name);

int sum=0;
for(int i=0;i<x.length;i++){
sum+=x[i].score;
}System.out.println("平均="+sum/x.length);

for(int i=0;i<x.length;i++){
if (x[i].score<60.0){
System.out.print("不及格者:");
x[i].printdata();
}
}
}
}

B9933133張靖 提到...

public class student {
String name;
int score;

public student(String x, int y) {
name = x;
score = y;
}

public static void main(String[] args) {
student[] x = new student[5];
x[0] = new student("學生一", 60);
x[1] = new student("學生二", 87);
x[2] = new student("學生三", 47);
x[3] = new student("學生四", 50);
x[4] = new student("學生五", 66);
for (int i = 1; i < x.length; i++)
if (x[i].score > x[0].score)
x[0] = x[i];
System.out.print(x[0].name);
}
}

B10133036孫翊玲 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分:"+x[m].name);

}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格:"+x[n].name);
}
}
}

B10133010蔡以翎 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分:"+x[m].name);

}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格:"+x[n].name);
}
}
}

B10133004徐芷瑩 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分:"+x[m].name);

}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格:"+x[n].name);
}
}
}

B10133010蔡以翎 提到...

public class student{
String name;
int scroe;
public student(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
apple x[] = new apple[5];
x[0]= new student("學生1", 60);
x[1]= new student("學生2", 87);
x[2]= new student("學生3", 47);
x[3]= new student("學生4", 50);
x[4]= new student("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分:"+x[m].name);

}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格:"+x[n].name);
}
}
}

B10133049 連于瑄 提到...

public class test{
String name;
int scroe;
public test(String name,int scroe){
this.name = name;
this.scroe = scroe;
}
public static void main(String[]args){
test x[] = new test[5];
x[0]= new test("學生1", 60);
x[1]= new test("學生2", 87);
x[2]= new test("學生3", 47);
x[3]= new test("學生4", 50);
x[4]= new test("學生5", 66);
int a =0;
int b = 0;
for(int i=0; i<x.length; i++){
b+= x[i].scroe;
if(a<x[i].scroe){
a= x[i].scroe;
}
}

for(int m=0; m<x.length; m++){
if(a==x[m].scroe){
System.out.println("最高分姓名:"+x[m].name);
System.out.println("最高分:"+a);
}
}
System.out.println("平均:"+b/x.length);
for(int n=0; n<x.length; n++)
if(x[n].scroe<60){
System.out.println("不及格姓名:"+x[n].name);
System.out.println("不及格分數:"+x[n].scroe);
}
}
}

B10133034石嘉萱 提到...

public class stdEX {

public static void main(String[] args) {
student x[]=new student[5];
x[0]=new student("學生1",60);
x[1]=new student("學生2",87);
x[2]=new student("學生3",47);
x[3]=new student("學生4",50);
x[4]=new student("學生5",66);

student max=x[0];
for(int j=0;jmax.score)
max=x[j];
}System.out.println("最高分:"+max.name);

int sum=0;
for(int j=0;j<x.length;j++){
sum+=x[j].score;
}System.out.println("平均="+sum/x.length);
}
}

B10133019 王騰侑 提到...

public class student {
String name ;
int score;
public student (String x, int y){
name = x;
score = y;

}

public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);

}

}

public class ex1 {



public static void main(String[] args) {
student[] X = new student[5];
X[0]= new student ("學生1", 60);
X[1]= new student ("學生2", 87);
X[2]= new student ("學生3", 47);
X[3]= new student ("學生4", 50);
X[4]= new student ("學生5", 66);
for(int i=0; i<X.length; i++)
X[i].printData();
int a =0;
for(int i=0 ; i<5; i++)
a+=X[i].score;
System.out.println("av="+a/5);

for(int i=0 ; i<5; i++)
if(X[i].score<60)
System.out.println("不及格="+X[i].name);

int c = 0 ;
for(int b=0 ; b<5; b++){

if (X[b].score >c)
c = X[b].score;

}System.out.println("最高分="+c);


}
}

B10133019 王騰侑 提到...

public class student {
String name ;
int score;
public student (String x, int y){
name = x;
score = y;

}

public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);

}

}

public class ex1 {



public static void main(String[] args) {
student[] X = new student[5];
X[0]= new student ("學生1", 60);
X[1]= new student ("學生2", 87);
X[2]= new student ("學生3", 47);
X[3]= new student ("學生4", 50);
X[4]= new student ("學生5", 66);
for(int i=0; i<X.length; i++)
X[i].printData();
int a =0;
for(int i=0 ; i<5; i++)
a+=X[i].score;
System.out.println("av="+a/5);

for(int i=0 ; i<5; i++)
if(X[i].score<60)
System.out.println("不及格="+X[i].name);

int c = 0 ;
for(int b=0 ; b<5; b++){

if (X[b].score >c)
c = X[b].score;

}System.out.println("最高分="+c);


}
}

B10133043陳宗霖 提到...

public class student {
String name ;
int score;
public student (String x, int y){
name = x;
score = y;

}

public void printData(){
System.out.print("name:"+name);
System.out.println("\tscore:"+score);

}

}

public class ex1 {



public static void main(String[] args) {
student[] X = new student[5];
X[0]= new student ("學生1", 60);
X[1]= new student ("學生2", 87);
X[2]= new student ("學生3", 47);
X[3]= new student ("學生4", 50);
X[4]= new student ("學生5", 66);
for(int i=0; i<X.length; i++)
X[i].printData();
int a =0;
for(int i=0 ; i<5; i++)
a+=X[i].score;
System.out.println("av="+a/5);

for(int i=0 ; i<5; i++)
if(X[i].score<60)
System.out.println("不及格="+X[i].name);

int c = 0 ;
for(int b=0 ; b<5; b++){

if (X[b].score >c)
c = X[b].score;

}System.out.println("最高分="+c);


}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章