Search

Solution Cart

Remove item Thumbnail image Product Price Quantity Subtotal
× (b) Modify the program in Q3(a), with the following new rules: - Players will need to win 3 games to become the overall winner. - Implement a penalty - for the player who skipped, entered an incorrect expression, or entered an expression that evaluated to the wrong result, will draw 2 random digits into their hand. - The player who loses the game will be awarded a "Skip" card in the next game. With the "Skip" card, the player can hit < Enter > to skip, without a penalty. - If not utilized, the "Skip" cards CANNOT be carried forward to the next game. Illustration of the "new" game on the left column, with the rules of the game explained on the right column: Enter player: Alan Enter player: Betty Enter player: Starting hand (number) of digits: 4 Let's play... Game 1 Round 1: Result 6 Betty's hand: [5,2,1,1] Enter expression: 5+1 Correct! Betty's hand: [2,1] Alan wins this game in 4 rounds!! Overall game score: Alan 1, Betty 0 Let's play... Game 2 Round 1: Result 5 Betty's hand: [3, 6, 5, 7, 'S'] Enter expression: Skipped with no penalty!! Betty's hand: [3,6,5,7] Alan's hand: [2,1,2,1] Enter expression: Skipped and 2 digits added to hand Alan's hand: [2,1,2,1,4,7] Betty wins this game in 5 rounds!! Overall game score: Alan 1, Betty 1 Let's play... Game 3 Round 1: Result 6 Betty's hand: [1, 2, 8, 7] Enter expression: 8-2 Correct! Betty's hand: [1, 7] Computer randomized the play sequence and will stay the same for every game/round End of game, if no overall winner, continue to play another game. Loser will be awarded a "Skip" card in the next game. "S" represents the "Skip" card awarded to Betty. No penalty for Betty as she has a "Skip" card. Hit < Enter > key to skip if cannot form an expression. In this case, the player who skipped will draw 2 random digits into their hand. End of game, if no overall winner, continue to play another game. Loser will be awarded a "Skip" card in the next game. (b) Modify the program in Q3(a), with the following new rules: – Players will need to win 3 games… $10.00
$10.00
× The University of Western Ontario Department of Computer Science London, Canada Software Tools and Systems Programming (Computer Science 2211A) LAB7 The week of October 22 - October 28, 2023 This lab is an exercise with pointer arithmetic. Question 2 of the lab exercise is taken from exercise 17 in Chapter 12 of our textbook: C Programming Language: A Modern Approach (Second Edition), by K. N. King. 1. Rewrite the following function to use pointer arithmetic instead of array subscripting. (In other words, eliminate the variables i and all of the [] operators.) Note that for any array a, the expression a[i] is equivalent to *(a+i). int sum_array(const int a[], int n) { int i, sum = 0; for (i = 0; i < n; i++) sum += a[i]; return sum; } THE UNIVERSITY OF WESTERN ONTARIO DEPARTMENT OF COMPUTER SCIENCE LONDON CANADA Software Tools and $5.00
$5.00

Cart totals

Subtotal $15.00
Total $15.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