Posts

Showing posts from May, 2024

Module lab OOP Week 7

 https://myunitechsolution.com/nextcloud/index.php/s/WxHjqqYgN6fxYaf

duty roster

 /*  * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license  * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template  */ package dutyroster; /**  *  * @author PC 48  */ public class DutyRoster {     /**      * @param args the command line arguments      */    //setiap hari hanya 3 org yg boleh cuti          int staffNumber;     int date_Start;     int staffcutiday1[][]= new int[7][3];               public void assignStaffcutibyDay(){                  //loop for each staff         int countcutiday1=0;         int countcutiday2=0;         int countcutiday3=0;         int countcutiday4=0;         int countcutiday5=0;         int countcutiday6=0;         int countcutiday7=0;                                    for(int a=0;a<staffNumber;){             int max=6;             int min=0;                        int daycuti=  (int)(Math.random() * (max - min + 1) + min)  ;                        if(daycuti==1 &&