Advertisement
panaewboi

job

Apr 17th, 2020
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. package specialproject;
  2.  
  3.  
  4. // Program to find the maximum profit job sequence from a given array of jobs with deadlines and profits
  5. // A structure to represent a job
  6. public class Job
  7. {
  8.    public int jobID; // Job Id
  9.    public int deadline; // Deadline of job
  10.    public int profit; // Profit if job is over before or on deadline
  11.  
  12.     Job(int i, int d, int p) {
  13.         this.jobID =i;
  14.         this.deadline = d;
  15.         this.profit = p;
  16.         }
  17.  
  18.     public int getId() {
  19.         return jobID;
  20.     }
  21.  
  22.     public int getDeadline() {
  23.         return deadline;
  24.     }
  25.  
  26.     public int getProfit() {
  27.         return profit;
  28.     }
  29.    
  30.     @Override
  31.     public String toString() {
  32.         return "Job{" + "id=" + jobID + ", deadline=" + deadline + ", profit=" + profit + '}';
  33.     }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement