網頁

2016年9月21日 星期三

Ex5 建立三個科目的物件

建立三個科目的物件,列印輸出。




提示:
Subject X[]=new Suject[3]
X[0]=new Sbject("...", *,*);
X[1]=.......
X[2]=.......
for(Suject a:X)
   a.print();



59 則留言:

  1. B10433023 李佳明2016年9月21日 上午10:51

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void println(){
    System.out.println
    (name+" : "+"分數 "+score+" 學分 : "+credit);
    }

    }

    public class ex5
    {
    public static void main(String[] args)
    {
    Subject x=new Subject("程式I",90,3);
    x.println();
    Subject y=new Subject("程式II",91,2);
    y.println();
    Subject z=new Subject("程式III",92,1);
    z.println();
    }
    }



    程式I : 分數 90 學分 : 3
    程式II : 分數 91 學分 : 2
    程式III : 分數 92 學分 : 1

    回覆刪除
  2. class S{
    String name;
    int X;
    int Y;
    public S(String name, int X, int Y) {
    super();
    this.name = name;
    this.X = X;
    this.Y = Y;
    }
    void print(){
    System.out.println(name+":"+X+"分\t"+Y+"學分");
    }
    }
    public class a01 {
    public static void main(String[] args) {
    S x[]=new S[3];
    x[0]=new S("程式",60,4);
    x[1]=new S("國文",75,2);
    x[2]=new S("統計",60,2);
    for(S a:x) a.print();
    }
    }

    回覆刪除
  3. package w2;
    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    super();
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    ("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class hw1 {
    public static void main(String[] args) {
    Subject X[]= new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("管理",70,3);
    X[2]=new Subject("資料庫",80,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  4. class Subject

    {

    String name;

    int score;

    int credit;

    public Subject(String name, int score, int credit)

    {

    this.name = name;

    this.score = score;

    this.credit = credit;

    }

    void print()

    {

    System.out.println(name+"\t名稱:"+score+"\t學分:"+credit);

    }

    }

    public class ex01 {

    public static void main(String[] args)

    {

    Subject X[]=new Subject[3];

    X[0]=new Subject("程式",90,3);

    X[1]=new Subject("數學",60,4);

    X[2]=new Subject("國文",80,2);

    for(Subject a:X)

    a.print();

    }

    }

    回覆刪除
  5. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    super();
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分"+credit);
    }
    }
    public class ex2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",85,2);
    X[2]=new Subject("資料庫",80,3);
    for(Subject a:X)
    a.print();

    }

    }

    回覆刪除
  6. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",90 ,3);
    X[1]=new Subject("資料結構",88 ,3);
    X[2]=new Subject("生產管理",85 ,2);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  7. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",80 ,4);
    X[1]=new Subject("資料結構",90 ,3);
    X[2]=new Subject("生產管理",88 ,2);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  8. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",88 ,3);
    X[1]=new Subject("資料結構",90 ,3);
    X[2]=new Subject("生產管理",82 ,2);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  9. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score,int credit){
    this.name=name;
    this.score=score;
    this.credit=credit;
    }
    void print(){
    System.out.println(name+":"+"分數:"+score+"學分:"+credit);
    }
    }

    public class ex1 {

    public static void main(String[] args) {
    Subject x[]=new Subject[3];
    x[0]=new Subject("英文",60,3);
    x[1]=new Subject("程式",70,3);
    x[2]=new Subject("數學",80,1);
    for(Subject a:x);
    a.print();
    }

    }

    回覆刪除
  10. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("微積分",65 ,2);
    X[1]=new Subject("進階程式設計",82 ,2);
    X[2]=new Subject("企業電子化",77 ,3);
    for(Subject a:X)
    a.print();

    }

    }

    回覆刪除
  11. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",85 ,3);
    X[1]=new Subject("資料結構",90 ,3);
    X[2]=new Subject("生產管理",92 ,2);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  12. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score,int credit){
    this.name= name;
    this.score=score;
    this.credit=credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }

    public class ex5 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();

    }



    }

    回覆刪除
  13. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",88 ,3);
    X[1]=new Subject("資料結構",90 ,3);
    X[2]=new Subject("生產管理",85 ,2);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  14. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("微積分",70 ,2);
    X[1]=new Subject("英文",65 ,3);
    X[2]=new Subject("體育",95 ,2);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  15. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    super();
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }

    public class HW1 {
    public static void main(String[] args) {
    Subject X=new Subject("程式",90,3);
    X.print();
    Subject Y=new Subject("國文",100,3);
    Y.print();
    Subject Z=new Subject("數學",100,3);
    Z.print();
    }

    }

    回覆刪除
  16. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }

    public class ex1 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",80,3);
    X[1]=new Subject("國文",90,2);
    X[2]=new Subject("會計",70,3);
    for(Subject a:X)
    a.print();
    }

    }

    回覆刪除
  17. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score,int credit){
    this.name=name;
    this.score=score;
    this.credit=credit;
    }
    void print(){
    System.out.println
    (name+":"+"分數"+score+"學分:"+credit);
    }
    }
    public class ex01 {
    public static void main(String[] args) {
    Subject X=new Subject("程式",80,3);
    Subject Y=new Subject("英文",75,2);
    Subject Z=new Subject("數學",86,2);
    X.print();
    Y.print();
    Z.print();
    }

    }

    回覆刪除
  18. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",90 ,3);
    X[1]=new Subject("資料結構",88 ,3);
    X[2]=new Subject("生產管理",85 ,2);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  19. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X=new Subject("程式",90,3);
    X.print();
    Subject Y=new Subject("國文",90,3);
    Y.print();
    Subject Z=new Subject("數學",90,3);
    Z.print();

    }

    }

    回覆刪除
  20. package date1;
    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    super();

    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name + ":" + "分數:" +score + "學分:" + credit);
    }
    }

    public class ex01 {

    public static void main(String[] args) {
    Subject X = new Subject("程式" , 90, 3);
    X.print();
    Subject y = new Subject("國文" , 90, 3);
    y.print();
    Subject z = new Subject("數學" , 90, 3);
    z.print();
    }

    }

    回覆刪除

  21. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",99 ,3);
    X[1]=new Subject("資料結構",88 ,3);
    X[2]=new Subject("生產管理",77 ,2);
    for(Subject a:X)
    a.print();

    }
    }

    回覆刪除

  22. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",55 ,3);
    X[1]=new Subject("資料結構",66 ,3);
    X[2]=new Subject("生產管理",77 ,2);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  23. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    super();
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X=new Subject("程式",90,3);
    X.print();
    Subject Y=new Subject("微積分",90,3);
    Y.print();
    Subject Z=new Subject("經濟學",90,3);
    Z.print();

    }

    }

    回覆刪除

  24. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  25. public class ex01 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new subject("程式",90,3);
    X[1]=new subject("微積分",80,2);
    X[1]=new subject("英文",88,1);
    for(subject a:X)
    a.print();
    }
    }

    回覆刪除
  26. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    super();
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X=new Subject("程式",90,3);
    X.print();
    Subject Y=new Subject("微積分",90,3);
    Y.print();
    Subject Z=new Subject("會計",90,3);
    Z.print();

    }

    }

    回覆刪除

  27. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除

  28. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除

  29. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除

  30. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除

  31. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除

  32. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  33. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit= credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {

    public static void main(String[] args) {
    Subject x=new Subject("程式",90,3);
    x.print();

    }

    }

    回覆刪除

  34. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除

  35. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  36. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit= credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {

    public static void main(String[] args) {
    Subject x=new Subject("程式",90,3);
    x.print();

    }

    }

    回覆刪除

  37. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除

  38. public class hw2 {

    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("微積分",80,2);
    X[2]=new Subject("英文",88,1);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  39. B10433001 林威翰2016年9月21日 下午5:45

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("基礎統計學",88 ,3);
    X[1]=new Subject("生產管理",84 ,3);
    X[2]=new Subject("程式設計",86 ,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  40. B10433047江景誠2016年9月21日 下午5:46

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("基礎統計學",75 ,3);
    X[1]=new Subject("生產管理",68 ,3);
    X[2]=new Subject("程式設計",74 ,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  41. B10333022李昕翰2016年9月21日 下午6:48

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.print
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("英文",82,1);
    X[1]=new Subject("人文藝術-西方藝術經典選粹",80 ,2);
    X[2]=new Subject("行銷管理",62 ,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  42. B10233136 巫駿驛2016年9月22日 凌晨12:23

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("基礎統計學",75 ,3);
    X[1]=new Subject("生產管理",68 ,3);
    X[2]=new Subject("程式設計",74 ,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  43. B10233028 王曉琪2016年9月28日 中午12:49

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex1 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("程式設計",80 ,2);
    X[1]=new Subject("作業系統",76 ,3);
    X[2]=new Subject("生產管理資訊系統",85 ,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  44. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name,int score, int credit){
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.print
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("英文",68,1);
    X[1]=new Subject("人文藝術-西方藝術經典選粹",78 ,2);
    X[2]=new Subject("資訊網路",60 ,3);
    for(Subject a:X)
    a.print();
    }

    回覆刪除
  45. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit=credit;
    }
    void print(){
    System.out.println
    ("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex5 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("英文",90,1);
    X[1]=new Subject("程式設計",60,3);
    X[2]=new Subject("資料庫",80,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  46. B10233082 唐偉強2016年12月16日 下午5:19

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void println(){
    System.out.println
    (name+" : "+"分數 "+score+" 學分 : "+credit);
    }

    }

    public class ex5
    {
    public static void main(String[] args)
    {
    Subject x=new Subject("程式I",90,3);
    x.println();
    Subject y=new Subject("程式II",91,2);
    y.println();
    Subject z=new Subject("程式III",92,1);
    z.println();
    }
    }



    程式I : 分數 90 學分 : 3
    程式II : 分數 91 學分 : 2
    程式III : 分數 92 學分 : 1

    回覆刪除
  47. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit= credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {

    public static void main(String[] args) {
    Subject x=new Subject("程式",90,3);
    x.print();

    }

    }

    回覆刪除
  48. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void println(){
    System.out.println
    (name+" : "+"分數 "+score+" 學分 : "+credit);
    }

    }

    public class ex5
    {
    public static void main(String[] args)
    {
    Subject x=new Subject("程式I",90,3);
    x.println();
    Subject y=new Subject("程式II",91,2);
    y.println();
    Subject z=new Subject("程式III",92,1);
    z.println();
    }
    }



    程式I : 分數 90 學分 : 3
    程式II : 分數 91 學分 : 2
    程式III : 分數 92 學分 : 1

    回覆刪除
  49. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit=credit;
    }
    void print(){
    System.out.println
    ("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex5 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("英文",90,1);
    X[1]=new Subject("程式設計",60,3);
    X[2]=new Subject("資料庫",80,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  50. B10233049 黃家崙2016年12月26日 下午2:38

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit=credit;
    }
    void print(){
    System.out.println
    ("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex5 {
    public static void main(String[] args) {
    Subject X[]=new Subject[3];
    X[0]=new Subject("英文",90,1);
    X[1]=new Subject("程式設計",60,3);
    X[2]=new Subject("資料庫",80,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  51. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit= credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {

    public static void main(String[] args) {
    Subject x=new Subject("程式",90,3);
    x.print();

    }

    }

    回覆刪除
  52. B10433040 葉峻宇2016年12月27日 下午5:47

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit= credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {

    public static void main(String[] args) {
    Subject x=new Subject("程式",90,3);
    x.print();

    }

    }

    回覆刪除
  53. class S{
    String name;
    int X;
    int Y;
    public S(String name, int X, int Y) {
    super();
    this.name = name;
    this.X = X;
    this.Y = Y;
    }
    void print(){
    System.out.println(name+":"+X+"分\t"+Y+"學分");
    }
    }
    public class a01 {
    public static void main(String[] args) {
    S x[]=new S[3];
    x[0]=new S("程式",60,4);
    x[1]=new S("國文",75,2);
    x[2]=new S("統計",60,2);
    for(S a:x) a.print();
    }
    }

    回覆刪除
  54. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit){
    this.name=name;
    this.score=score;
    this.credit= credit;
    }
    void print(){
    System.out.println
    (name+":"+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class ex01 {

    public static void main(String[] args) {
    Subject x=new Subject("程式",90,3);
    x.print();

    }

    }

    回覆刪除
  55. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void println(){
    System.out.println
    (name+" : "+"分數 "+score+" 學分 : "+credit);
    }

    }

    public class ex5
    {
    public static void main(String[] args)
    {
    Subject x=new Subject("程式I",90,3);
    x.println();
    Subject y=new Subject("程式II",91,2);
    y.println();
    Subject z=new Subject("程式III",92,1);
    z.println();
    }
    }



    程式I : 分數 90 學分 : 3
    程式II : 分數 91 學分 : 2
    程式III : 分數 92 學分 : 1

    回覆刪除
  56. class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void println(){
    System.out.println
    (name+" : "+"分數 "+score+" 學分 : "+credit);
    }

    }

    public class ex5
    {
    public static void main(String[] args)
    {
    Subject x=new Subject("程式I",90,3);
    x.println();
    Subject y=new Subject("程式II",91,2);
    y.println();
    Subject z=new Subject("程式III",92,1);
    z.println();
    }
    }



    程式I : 分數 90 學分 : 3
    程式II : 分數 91 學分 : 2
    程式III : 分數 92 學分 : 1

    回覆刪除
  57. package w2;
    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    super();
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void print(){
    System.out.println
    ("名稱:"+name+"\t分數:"+score+"\t學分:"+credit);
    }
    }
    public class hw1 {
    public static void main(String[] args) {
    Subject X[]= new Subject[3];
    X[0]=new Subject("程式",90,3);
    X[1]=new Subject("管理",70,3);
    X[2]=new Subject("資料庫",80,3);
    for(Subject a:X)
    a.print();
    }
    }

    回覆刪除
  58. b10433012 鍾仁凱2017年1月2日 下午3:26

    包W2;
    類主題{
    字符串名稱;
    INT分;
    詮釋信用;
    公共科目(字符串名稱,詮釋得分,詮釋信貸){
    超();
    this.name =名稱;
    this.score =得分;
    this.credit =貸款;
    }
    無效的print(){
    的System.out.println
    (“名稱:”+姓名+“\ t分數:”+分數+“\ t學分:”+信用);
    }
    }
    公共類HW1 {
    公共靜態無效的主要(字串[] args){
    主題X [] =新的主題[3];
    X [0] =新主題(“程式”,90,3);
    X [1] =新主題(“管理”,70,3);
    X [2] =新主題(“資料庫”,80,3);
    對於(但一個:X)
    a.print();
    }
    }

    回覆刪除
  59. b10433043彭子豪2017年1月4日 上午10:45

    class Subject{
    String name;
    int score;
    int credit;
    public Subject(String name, int score, int credit) {
    this.name = name;
    this.score = score;
    this.credit = credit;
    }
    void println(){
    System.out.println
    (name+" : "+"分數 "+score+" 學分 : "+credit);
    }

    }

    public class ex5
    {
    public static void main(String[] args)
    {
    Subject x=new Subject("程式I",90,3);
    x.println();
    Subject y=new Subject("程式II",91,2);
    y.println();
    Subject z=new Subject("程式III",92,1);
    z.println();
    }
    }



    程式I : 分數 90 學分 : 3
    程式II : 分數 91 學分 : 2
    程式III : 分數 92 學分 : 1

    回覆刪除

HTML 編輯器