Java 为办公室写一周日记

Java 为办公室写一周日记,java,Java,我正试着为牙医写一周的日记。牙医每天从8点工作到5点,但有一小时的休息时间。牙医执行4个程序: 常规程序需要15分钟 缩放需要30分钟 填充需要45分钟,并且 提取需要90分钟 日记应该能够预订约会、取消现有约会以及检查约会是否安排在特定时间。下面是我到目前为止所写内容的一个示例。我决定为4个不同的过程创建一个类,然后在其构造函数中创建一个包含所有4个过程的过程类。不过,我不知道如何把程序写进日记 // a regular procedure class that takes 15 minu

我正试着为牙医写一周的日记。牙医每天从8点工作到5点,但有一小时的休息时间。牙医执行4个程序:

  • 常规程序需要15分钟
  • 缩放需要30分钟
  • 填充需要45分钟,并且
  • 提取需要90分钟
日记应该能够预订约会、取消现有约会以及检查约会是否安排在特定时间。下面是我到目前为止所写内容的一个示例。我决定为4个不同的过程创建一个类,然后在其构造函数中创建一个包含所有4个过程的过程类。不过,我不知道如何把程序写进日记

// a regular procedure class that takes 15 minutes
public class RegularProcedure {
       // the duration period of a regular procedure is 15
   private  int []procedure;
    static final int  times=15;

     public RegularProcedure(){

         procedure=new int[times];
         for(int i=0; i <procedure.length;i++){
             procedure[i]=i;
         }
     }
}

公共课堂日记{
私人int[][]日记;
国际[]日;
程序y;
//一周的日记
公众日记(){
日记=新整数[5][540];
y=新程序();

对于(int i=0;i一条建议,重新思考整个问题。但首先,学习一些基本的OO编程。您的不同过程应该是
过程的子类。
。了解“has a”和“is a”之间的区别


“我正试着为牙医写一周日记。”告诉牙医买一本,除非这是家庭作业,如果是,请添加
家庭作业
标签。其他提示:1)找到你的shift键并在每个句子的开头应用它一次。2)问一个特定的问题。3)使用代码格式标签。4)接受一些答案。5)发布一个帖子。你应该试着问一个更具体一点的问题。试着把这个问题归结为一个特定的问题,让我们知道你已经尝试了什么。@jules am workin我的具体问题是如何在我的日记课中预约缩放程序
类程序的构造函数让我很痒。你的意思是将我的不同程序扩展到这个程序吗class@logic是的。它将允许您使用
列表数组
。您可以从中继续。
// a scaling class that takes 30 minutes
public class Scaling {
    private int []scaling;
    static final int time=30;


    public Scaling(){

        scaling =new int[time];
        for (int i=0;i<scaling.length;i++){
            scaling[i]=i;
        }
    }
}
// a filling procedure class that taked 45 mins to complete a procedure 
public class Filling {
    private int[]filling;
    static final int time=45;


    public Filling(){

       filling=new int[time];
       for(int i=0;i<filling.length;i++){
           filling[i]=i;
       }
    }
}
// an extraction class that takes 90 minutes 
public class Extraction {
  private int[]extraction;
 static final int time=90;


 public Extraction(){

       extraction = new int[time];
       for(int i=0; i<extraction.length;i++){
           extraction [i]=i; 
       }
   }
}
// a procedure class that contains that contains the four procedures performed by d dentist
public class Procedures {
    RegularProcedure a;
    Scaling b;
    Filling c;
     Extraction d;

    public Procedures(){
        a= new RegularProcedure();
        b= new Scaling();
        c= new Filling();
        d= new Extraction();
    }
}
public class Diary {
  private int [][]diary;
  int []diaryday;
   Procedures y;

   //a diary constructor for a week
   public Diary(){

       diary=new int[5][540];
       y=new Procedures();
     for (int i=0; i<diary.length;i++) {
         for(int j=0;j <diary[i].length;j++){
             diary[i][j]= 0; 
         }
     }
   }

   /* method to determine if dentist office is open or on 
    * break
    */
     public Boolean isOnBreak(int time){
         if(time>=0 &&time<240 ||time>=300 &&time<540){
             return false;}
         else 
             return true;
     }    
}