標題:
作業-成績單
[打印本頁]
作者:
may
時間:
2021-11-19 23:00
標題:
作業-成績單
請以陣列語法,完成以下5個學生的成績表,如下圖
[attach]12300[/attach][attach]12300[/attach]
作者:
顏宇鋒
時間:
2021-11-26 22:01
public class Ch01
{
public static void main(String args[])
{
String x[][]={{"三民國小","小叮噹","90","85","85","97","89"},
{"大同國小","大雄","70","75","80","85","77"},
{"七賢國小","宜靜","80","95","80","77","83"},
{"河堤國小","技安","70","95","75","98","84"},
{"鼓山國小","阿福","80","85","95","86","86"}};
System.out.println("學校\t姓名\t國文\t英文\t數學\t社會\t平均");
System.out.println("====================================================");
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
System.out.print(x[i][j]+"\t");
System.out.println();
}
}
}
複製代碼
作者:
文硯
時間:
2021-11-26 23:50
public class Ch01
{
public static void main(String args[])
{
int score[][]={{90,85,85,97},{70,75,80,85},{80,95,80,77},{70,95,75,98},{80,85,95,86}};
String school[]={"三明國小","大同國小","七賢國小","河堤國小","鼓山國小"};
String name[]={"小叮噹","大雄","宜靜","技安","阿福"};
System.out.println("學校\t姓名\t國文\t英文\t數學\t社會\t平均");
System.out.println("===========================================================");
for(int i=0; i<5; i++)
{
System.out.print(school[i]+"\t"+name[i]+"\t");
for(int j=0; j<4; j++)
System.out.print(score[i][j]+"\t");
System.out.println((score[i][0]+score[i][1]+score[i][2]+score[i][3])/4);
}
}
}
複製代碼
作者:
徐茂程
時間:
2021-11-27 19:04
本帖最後由 徐茂程 於 2021-11-27 20:10 編輯
public class a {
public static void main(String[] args) {
// TODO 自動產生的方法 Stub
String school[]={"三明國小","大同國小","七賢國小","河堤國小","鼓山國小"};
String name[]={"小叮噹","大雄","宜靜","技安","阿福"};
int X[][]={{90,85,85,97},{70,75,80,85},{80,95,80,77},{70,95,75,98},{80,85,95,86}};
System.out.println("==============================================================");
System.out.println("學校\t姓名\t國文\t英文\t數學\t社會\t平均");
for(int i=0;i<5;i++){
System.out.print(school[i]+"\t"+name[i]+"\t");
for(int j=0;j<4;j++){
System.out.print(X[i][j]+"\t");
}
System.out.println((X[i][0]+X[i][1]+X[i][2]+X[i][3])/4);
}
}
}
複製代碼
作者:
蔡旭恩
時間:
2021-11-27 19:58
public class Ch01
{
public static void main(String[] args)
{
String school[]={"三名","大同","七賢","河堤","鼓山"};
String name[]={"小叮噹","大雄","宜靜","技安","阿富"};
int n[][]={{90,85,85,97},{70,75,80,85},{80,95,80,77},{70,95,75,98},{80,85,95,86}};
System.out.println("學校\t姓名\t國文\t英文\t數學\t社會\t平均");
System.out.println("======================================================");
for(int i=0; i<5; i++)
{
System.out.print(school[i]+"國小\t"+name[i]+"\t");
for(int j=0; j<4; j++)
{
System.out.print(n[i][j]+"\t");
}
System.out.print((n[i][0]+n[i][1]+n[i][2]+n[i][3])/4);
System.out.println();
}
}
}
複製代碼
作者:
張博竣
時間:
2021-11-27 20:04
public class Ch01 {
public static void main(String[] args) {
// TODO 自動產生的方法 Stub
String school[]={"三民","大同","七賢","河堤","鼓山"};
String name[]={"小叮噹","大雄","宜靜","技安","阿福"};
int n[][]={{90,85,85,97},
{70,75,80,85},
{80,95,80,77},
{70,95,75,98},
{80,85,95,86}};
System.out.println("學校\t姓名\t國文\t英文\t數學\t社會\t平均");
System.out.println("==========================================================");
for(int i=0;i<5;i++)
{
System.out.print(school[i]+"國小\t"+name[i]+"\t");
for(int j=0;j<4;j++)
{
System.out.print(n[i][j]+"\t");
}
System.out.println((n[i][0]+n[i][1]+n[i][2]+n[i][3])/4);
}
}
}
複製代碼
作者:
吳湘儀
時間:
2021-11-27 20:06
public class Ch02 {
public static void main(String[] args) {
// TODO 自動產生的方法 Stub
String school[]={"三民","大同","七賢","河堤","鼓山"};
String name[]={"小叮噹","大雄","宜靜","技安","阿福"};
int n[][]={{90,85,85,97},
{70,75,80,85},
{80,95,80,77},
{70,95,75,98},
{80,85,95,86}};
System.out.println("學校\t姓名\t國文\t英文\t數學\t社會\t平均");
System.out.println("=====================================================");
for(int i=0; i<5; i++)
{
System.out.print(school[i]+"國小\t"+name[i]+"\t");
for(int j=0; j<4; j++)
{
System.out.print(n[i][j]+"\t");
}
System.out.println((n[i][0]+n[i][1]+n[i][2]+n[i][3])/4);
}
}
}
複製代碼
作者:
曾元瑜
時間:
2021-11-27 20:10
public class Ch01 {
public static void main(String[] args) {
// TODO 自動產生的方法 Stub
String school[]={"三民國小","大同國小","七賢國小","河堤國小","鼓山國小"};
String name[]={"小叮噹","大雄","宜靜","技安","阿福"};
int grade[][]={{90,85,85,97,89},
{70,75,80,85,77},
{80,95,80,77,83},
{70,95,75,98,84},
{80,85,95,86,86}};
System.out.println("學校\t姓名\t國文\t英文\t數學\t社會\t平均");
System.out.println("====================================================");
for(int i=0;i<5;i++)
{
System.out.print(school[i]+"\t"+name[i]+"\t");
for(int j=0;j<4;j++)
{
System.out.print(grade[i][j]+"\t");
}
System.out.println((grade[i][0]+grade[i][1]+grade[i][2]+grade[i][3])/4);
}
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2