[偷可] 程設....

看板TTU-Transfer作者 (大ing)時間17年前 (2008/12/19 11:58), 編輯推噓-3(037)
留言10則, 5人參與, 最新討論串1/2 (看更多)
唉..... 頭好痛 昨天整晚沒睡 送我哥他新馬子(瑞士人 去機場 兩點去6點半回到家........... 剛上語文表達超想睡覺~"~ 最近用GOOGLE查到一個國小三四年級同學,會不會有點誇張XDDDDD 而且她也是鄉民 (看到來回一下啊XDD 是個台北醫學院的強者!!!! 現在程設來練吧XD class ptt { private static double pi=3.14; private static double r; //provate static double area; private ptt(double fa) { r=fa; //area=pi*r*r; } public void show() { System.out.println("area="+pi*r*r); } } public class fate { public static void main(String args) { ptt pt[]=new ptt[3]; pt[0]=new fa(1,0); pt[1]=new fa(2,0); pt[2]=new fa(3,0); } } 9-13 class CScore { private String name; private int math; private int eng; private CScore(String str,int m,int e) { name=str; math=m; eng=e; } public void mathAvg(CScore c[]) { int sum=0; for(int i=0;i<c.length;i++) sum+=c[i].math; System.out.println("The average of math is "+math"); System.out.println((double)sum/c.length); //return(double)sum/c.length; } public void mathTop(CScore c[]) { int max=c[0].math; String str=c[0].name; for(int i=0;i<c.length;i++) { if (c[i].math>max) { max=c[i].math; str=c[i].name; } } System.out.println("The top score of math is "+math"); System.out.println("The name is "+str); public void engAvg(CScore c[]) { int sum=0; for(int i=0;i<c.length;i++) sum+=c[i].eng; System.out.println("The average of english is "); System.out.println((double)sum/c.length); //return(double)sum/c.length; } public void engTop(CScore c[]) { int max=c[0].eng; String str=c[0].name; for(int i=0;i<c.length;i++) { if (c[i].eng>max) { max=c[i].eng; str=c[i].name; } } System.out.println("The top score of english is "+eng"); System.out.println("The name is "+str); public void show (CScore c[]) { System.out.println("Name"+"/t"+"Math"+"\t"+"English+"\t"); for (int i=0;i<c.lenth;i++) { System.out.println(c[i].name+"\t"+c[i].math+"\t"+c[i].neglish+"\t"); } } } puvlic class app9_13 { public static void main(String args[]) { CScore sco[]=new CScore sco[0]=new CScore("Fiona",86, 92); sco[1]=new CScore("Ryan",95, 79); sco[2]=new CScore("Ariel,81, 83); sco[0].show(score); sco[0].mathAvg(score); sco[0].matTop(score); sco[0].engTop(score); } } 幹亂掉了 幫我改到好= = 不知道抄的亂七八遭................. 會有多少錢呢 拭目以待 禾斗禾斗 幫我修^^ (遞卡 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.129.26.2

12/19 11:58, , 1F
812XDDDDDDDDDDDDDDDD
12/19 11:58, 1F

12/19 15:45, , 2F
........(無言)
12/19 15:45, 2F

12/19 15:46, , 3F
騙太大了...我都沒梗可以騙....
12/19 15:46, 3F

12/19 22:31, , 4F
你不要亂取class的名字好不好 原PO自肥
12/19 22:31, 4F

12/19 23:20, , 5F
有點亂= = 變數要取易懂點的名字
12/19 23:20, 5F

12/19 23:20, , 6F
其實我不會寫java 但看得懂XD
12/19 23:20, 6F

12/19 23:25, , 7F
CLASS的名稱是題目定的= =
12/19 23:25, 7F

12/20 11:29, , 8F
那你可以告訴我 public class fate 是怎麼回事嗎= =?
12/20 11:29, 8F

12/20 11:43, , 9F
那只是隨便設定CLASS= =
12/20 11:43, 9F

12/22 02:23, , 10F
= =
12/22 02:23, 10F
文章代碼(AID): #19InlPBz (TTU-Transfer)
討論串 (同標題文章)
文章代碼(AID): #19InlPBz (TTU-Transfer)