Skip to content

a-kieu/CS540-Programming-Assignment-2-Lottery-Scheduling-Algorithm

Repository files navigation

CS540-Programming-Assignment-2-Lottery-Scheduling-Algorithm

Implementing lottery scheduling algorithm with C++ on Visual Studio.

In this program, you will only need to input numbers from 1-5. Any other numbers, letters, and symbols will be invalid and ignored.


OPENING THE PROGRAM:

  • Open the Visual Studio Solution file --> Lottery Scheduling Algorithm.sln --> on the top left, press view "solution explorer" --> double click "Lottery Scheduling Algorithm" --> go to the drop down arrow on source files --> double click "Lottery Scheduling Algorithm.cpp"
  • At the top in the middle, select --> Local Windows Debugger (to run the code)

The program will display a menu with 1-5 options.

Option number [1] Display Current Schedule

Option number [2] Add Sample Processes to the Schedule

Option number [3] Run the Lottery

Option number [4] Remove Front Process

Option number [5] Exit


Although the user cannot add their own process ID and the number of tickets, they can still test if the algorithm works by deleting the front process and then running the lottery. Whichever process was deleted, will not ever occur as a winner.


Sample user input sequence:

[1] Display Current Schedule (should be empty)

[2] Add the 4 sample processes

[1] Display the current process scheduler (should have processes 1-4)

[3] Run the Lottery (Keep pressing 3 until you see every process winning at least once (1-4 should get a chance)

[4] Removes the front process (removes 1)

[1] Display the current process scheduler (should have processes 2,3,4)

[3] Run the Lottery (Keep pressing 3, process 1 should never appear as a winner)

[4] Removes the front process (removes 2)

[4] Removes the front process (removes 3)

[1] Display the current process scheduler (should only have process 4)

[3] Run the Lottery (Keep pressing 3, the only possible winner is process 4)

If the user wants to reset, remove processes with [4] until empty, check with [1], then add the processes back by pressing [2] once.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages