Coding in C++

The following is a piece of code for a project I worked on simulating operating systems schedulers. I will not include the full 2000 lines of code the project entailed as it was a large project for one of the classes I was in and don’t wish to give students an easy A!

The code itself ended up so long because I chose to make a single program be able to simulate all of the necessary scheduling processes. A single CPP file acted as the driver, allowing the user to choose which scheduling procedures would be run.

If you want to see one of the scheduling process simulations in action and are a potential employer, feel free to contact me.

Hash Table Initialization: Constructors

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Function Name: Client_Info_List
//Precondition: Constructor has not been invoked
//Postcondition: Front and back=0; new character created
//Description: Constructs an instance of a character object
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Process_List::Process_List()
{
front=new Process_Node;
front=NULL;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Function Name: Client_Address_Book
//Precondition: Constructor has not been invoked
//Postcondition: Front and back=0; new character created
//Description: Constructs an instance of a character object
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Process_Table::Process_Table()
{
int count=0;

while(count<=8) { Process_List P_List; process_table[count]=P_List; count++; } //set up the hashtable }

Hash Table Initialization: Destructors

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Function Name: Client_Info_List
//Precondition: Constructor has not been invoked
//Postcondition: Front and back=0; new character created
//Description: Constructs an instance of a character object
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Process_List::Process_List()
{
front=new Process_Node;
front=NULL;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Function Name: Client_Address_Book
//Precondition: Constructor has not been invoked
//Postcondition: Front and back=0; new character created
//Description: Constructs an instance of a character object
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
Process_Table::Process_Table()
{
int count=0;

while(count<=8) { Process_List P_List; process_table[count]=P_List; count++; } //set up the hashtable }

Example Output for Scheduler