Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement a Lottery Scheduling System The program source code in C is also provided https://github.com/remzi-arpacidusseau/ostep-code/tree/master/cpu-sched-lotte Read, test, and modify the given code to complete this
Implement a Lottery Scheduling System
The program source code in C is also provided https://github.com/remzi-arpacidusseau/ostep-code/tree/master/cpu-sched-lotte Read, test, and modify the given code to complete this assignment Instructions Write a program in C named lotto.c that simulates a lottery scheduling system, with the following requirements: The scheduling system manages a linked list of users, each with a linked list of jobs belonging to that user (the chart below represents the linked lists produced by the program using the same user inputs as shown in the sample output) . User C Tix: 20 User B TIX: 50 User A Tix: 100 HEAD NULL Job 1 Tix: 100 Job 2 Tix 100 Job 1 Tix: 250 HEAD NULL I HEAD NULL Job 2 Tix 150 Job 1 Tix 350 HEAD . The program prompts the user to enter the number of tickets for each user and jolb . Once the queue is fully populated, one winning user and winning job are randomly selected Sample Output s ./lotto Enter number of tickets for a user (1 when finished 100 Enter number of tickets for a job (1 when finished 350 Enter number of tickets for a job (-1 when finished 150 Enter number of tickets for a job (-1 when finished): -1 Enter number of tickets for a user (1 when finished) 50 Enter number of tickets for a job (-1 when finished) 250 Enter number of tickets for a job (1 when finished 100 Enter number of tickets for a job (-1 when finished): -1 Enter number of tickets for a user (1 when finished) 20 Enter number of tickets for a job (-1 when finished) 100 Enter number of tickets for a job (-1 when finished): -1 Enter number of tickets for a user (1 when finished)-1 Users: [20] [50] [100] Winning Ticket: 33 Winning User: [50] Jobs: [100] [250] Winning Ticket: 106 Winning Job: 2501 The program source code in C is also provided https://github.com/remzi-arpacidusseau/ostep-code/tree/master/cpu-sched-lotte Read, test, and modify the given code to complete this assignment Instructions Write a program in C named lotto.c that simulates a lottery scheduling system, with the following requirements: The scheduling system manages a linked list of users, each with a linked list of jobs belonging to that user (the chart below represents the linked lists produced by the program using the same user inputs as shown in the sample output) . User C Tix: 20 User B TIX: 50 User A Tix: 100 HEAD NULL Job 1 Tix: 100 Job 2 Tix 100 Job 1 Tix: 250 HEAD NULL I HEAD NULL Job 2 Tix 150 Job 1 Tix 350 HEAD . The program prompts the user to enter the number of tickets for each user and jolb . Once the queue is fully populated, one winning user and winning job are randomly selected Sample Output s ./lotto Enter number of tickets for a user (1 when finished 100 Enter number of tickets for a job (1 when finished 350 Enter number of tickets for a job (-1 when finished 150 Enter number of tickets for a job (-1 when finished): -1 Enter number of tickets for a user (1 when finished) 50 Enter number of tickets for a job (-1 when finished) 250 Enter number of tickets for a job (1 when finished 100 Enter number of tickets for a job (-1 when finished): -1 Enter number of tickets for a user (1 when finished) 20 Enter number of tickets for a job (-1 when finished) 100 Enter number of tickets for a job (-1 when finished): -1 Enter number of tickets for a user (1 when finished)-1 Users: [20] [50] [100] Winning Ticket: 33 Winning User: [50] Jobs: [100] [250] Winning Ticket: 106 Winning Job: 2501Step 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