Sort by

recency

|

1021 Discussions

|

  • + 1 comment
    function libraryFine(d1, m1, y1, d2, m2, y2) {
        if(y1 > y2) return 10000; 
        if(y1 === y2 && m1 > m2) return (m1 - m2) * 500; 
        if(y1 === y2 && m1 === m2 && d1 > d2) return (d1 - d2) * 15; 
        return 0;     
       // you are unstopable 🦅!! 
      // happy coding 😍
    }
    
  • + 0 comments

    Here is my c++ solution, you can watch the explanation here : https://youtu.be/EhPgZkwwx4Y

    int libraryFine(int d1, int m1, int y1, int d2, int m2, int y2) {
        int res = 0;
        if(y1<y2 || (y1 == y2 && m1<m2) || (y1 == y2 && m2 == m1 && d1<=d2)) return 0;
        if(y2 == y1){
            if(m1 == m2) return 15 * (d1 - d2);
            else return (m1 - m2) * 500;
        }
        else return 10000;
        return 0;
    }
    
  • + 0 comments

    Just a quick reminder about library fines! It's easy to overlook a due date when life gets busy. But don’t worry—many libraries offer grace periods or options to waive fines through community events. Speaking of events, if you're looking for help with planning, check out an Event Consultant in West Palm Beach, Florida! They can make your gatherings memorable! Visit Website

  • + 0 comments
    
    

    public static int libraryFine(int d1, int m1, int y1, int d2, int m2, int y2) {

         if(y1<y2) return 0;
         if(d1>d2 && m1<m2 && y1<=y2) return 0;
         if(d1>d2 && m1<=m2 && y1<=y1) return 15*(d1-d2);
         if(m1>m2 && y1<=y2) return 500*(m1-m2);
         if(d1<=d2 && m1<=m2 && y1<=y2) return 0;
         return 10000;
    
    }
    
    
    
  • + 1 comment

    My C code 😎😁

    int libraryFine(int d1, int m1, int y1, int d2, int m2, int y2) {
        if(y1 > y2){
            return 10000;
        }
        if(d1>d2 && m1 == m2 && y1 == y2){
            int fine = (d1 - d2)*15;
            return fine;
        }
        if(m1 > m2 && y1 == y2){
            int fine = 500*(m1 - m2);
            return fine;
        }
        return 0;
    }