Search

Solution Cart

Remove item Thumbnail image Product Price Quantity Subtotal
× Sample output of the Banker's Algorithm: - Enter claim graph - Request resource - Release resource - Determine safe sequence - Quit program Enter selection: 1 Enter number of resources: 3 Enter number of units for resources (r0 to r2): 1057 Enter number of processes: 5 Enter maximum number of units process p0 will claim from each resource (r0 to r2): 753 Enter maximum number of units process p1 will claim from each resource (r0 to r2): 322 Enter maximum number of units process p2 will claim from each resource (r0 to r2): 902 Enter maximum number of units process p3 will claim from each resource (r0 to r2): 222 Enter maximum number of units process p4 will claim from each resource (r0 to r2): 433 Enter number of units of each resource (r0 to r2) currently allocated to process p0: 0 1 0 Enter number of units of each resource (r0 to r2) currently allocated to process p1: 2 0 0 Enter number of units of each resource (r0 to r2) currently allocated to process p2: 2 0 2 Enter number of units of each resource (r0 to r2) currently allocated to process p3: 21 1 Enter number of units of each resource (r0 to r2) currently allocated to process p4: 0 1 2 Available: r0 r1 r2 3 3 2 Allocated: r0 r1 r2 p0 0 1 0 p1 2 0 0 p2 3 0 2 p3 2 1 1 p4 0 0 2 Need: r0 r1 r2 p0 7 4 3 p1 1 2 2 p2 6 0 0 p3 0 1 1 p4 4 3 1 Banker's Algorithm: - Enter claim graph - Request resource - Release resource - Determine safe sequence - Quit program Enter selection: 4 Comparing: 743=332 : Process p0 cannot be sequenced Comparing: 122=332 : Process p1 can be sequenced Comparing: 60=532 : Process p2 cannot be sequenced Comparing: 011=532 : Process p3 can be sequenced Comparing: 431=743 : Process p4 can be sequenced Comparing: 743=745 : Process p0 can be sequenced Comparing: 600=755 : Process p2 can be sequenced Safe sequence of processes: p1 p3 p4 p0 p2 Banker's Algorithm: - Enter claim graph - Request resource - Release resource - Determine safe sequence - Quit program Enter selection: 2 Enter requesting process: p2 Enter requested resource: r0 Enter number of units process p2 is requesting from resource r0: 1 Enter selection: 3 Enter releasing process: p4 Enter released resource: r1 Enter number of units process p4 is releasing from resource r1: 1 Resources: r0 10 5 3 r1 0 4 1 r2 2 2 7 Available: r0 r1 r2 0 4 2 Max Claim: r0 r1 r2 p0 7 5 3 p1 3 2 2 p2 9 0 2 p3 2 2 2 p4 4 3 3 Allocated: r0 r1 r2 p0 0 1 0 p1 2 0 0 p2 2 0 2 p3 2 1 1 p4 0 1 2 Need: r0 r1 r2 p0 7 4 3 p1 1 2 2 p2 7 0 0 p3 0 1 1 p4 4 2 1 Enter selection: 4 Comparing: 743=332 : Process p0 cannot be sequenced Comparing: 122=332 : Process p1 can be sequenced Comparing: 60=532 : Process p2 cannot be sequenced Comparing: 011=532 : Process p3 can be sequenced Comparing: 431=743 : Process p4 can be sequenced Comparing: 743=745 : Process p0 can be sequenced Comparing: 600=75 : Process p2 can be sequenced Safe sequence of processes: p1 p3 p4 p0 p2 Banker's Algorithm: - Enter claim graph - Request resource - Release resource - Determine safe sequence - Quit program Enter selection: 5 Quitting program... Sample output Bankers Algorithm 1 Enter claim graph 2 Request resource 3 Release resource 4 $5.00
$5.00
× - Three cats with names- Mia, Ruby and Snowy are playing Rock-Paper-Scissors. - Basic rules of the game are: Rock beats scissors, scissors beat paper, and paper beats rock. - Each cat gains 3.5 points per win, loses a point per match lost, and gains 1.5 points if a match is drawn. - A total of 5 matches were played between Snowy and Mia. Snowy threw rock, paper, and scissors while Mia threw scissors, paper, and rock in the first three matches. In the last 2 matches, both Snowy and Mia threw rock. - Mia and Ruby played 3 matches in which Ruby threw rock three times while Mia threw paper, rock, and scissors. - 7 matches were played between Snowy and Ruby. Snowy threw rock, scissors, rock, paper, paper, rock, scissors while Ruby threw scissors, rock, scissors, scissors, rock, paper, scissors respectively. - Interpret the above data to display/fill the table on the next page. - Instructions and Hints: - Display the column Match Number using string data type. - Display table headings using cout in C++ - Display columns with headings Gesture using string data type. Use the information provided above to fill these columns for each cat. - Create 2-D arrays for columns-Won, Lost and Draw. You are required to enter the number of points, not the no. of wins, loses, or draws under these columns. Use for loops and if-else statements to fill the information under these columns. - Create a sum function to calculate Points (=sum of Win, loss and draw per match) for each cat. - Create a mean function to calculate "Average" for columns- Won, Lost, Draw and Points. - Calculate Winning probability using the following formula. WinningProbability=TotalnumberofOutcomesNumberoffavourableOutcomes100 - PS: Calculations for -Won, Lost, Drawn and Winning Probability should be done using for loops, if-else statements. Calculation under Points and Average should be done using functions for 2D arrays. You may call a function for 2D arrays with or without using pointers! – Three cats with names- Mia, Ruby and Snowy are playing Rock-Paper-Scissors. – Basic rules of the… $15.00
$15.00

Cart totals

Subtotal $20.00
Total $20.00

You may be interested in…

Free Worldwide shipping

On all orders above $50

Easy 30 days returns

30 days money back guarantee

International Warranty

Offered in the country of usage

100% Secure Checkout

PayPal / MasterCard / Visa