Question
Please create a driver for this program class PCB { protected int process_number; protected int process_state; protected int pc; protected int reg1; protected int mem_limit;
Please create a driver for this program
class PCB { protected int process_number; protected int process_state; protected int pc; protected int reg1; protected int mem_limit; protected PCB link; /* Constructor */ public PCB() { process_number = 0; process_state = 0; pc = 0; reg1 = 0; mem_limit = 0; link = null; } /* Constructor */ public PCB(int n1, int n2, int n3, int n4, int n5, PCB n) { process_number = n1; process_state = n2; pc = n3; reg1 = n4; mem_limit = n5; link = n; } /* Function to set link to next PCBe */ public void setLink(PCB n) { link = n; } /* Function to set data to current PCB */ public void setData(int n1, int n2, int n3, int n4, int n5) { process_number = n1; process_state = n2; pc = n3; reg1 = n4; mem_limit = n5; } /* Function to get link to next PCB */ public PCB getLink() { return link; } /* Function to get data from current Node */ /*You can return values using class, or array, or list*/ /* but here we will return one value for explanation purpose */ public int getPnumber() { return process_number; } public int getPstate() { return process_state; } public int getPc() { return pc; } public int getPreg1() { return reg1; } public int getPmem() { return mem_limit; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started