Due: June 6, 2024; late due date is June 11
Points: 100
1. In problem 1, if the square is occupied, you need to give the error message. “%c has played %d,%d\n” (where “%c” is either “X” or “O”, whichever is already in the square, and “%d,%d” are the co-ordinates of the occupied square).
2. In problem 1, the dimensions of the “O” was added; it is to be 5 × 5 centered in the square.
3. For all problems, the exit status code is 0.
The “O” is to be 5 × 5, centered in the middle of the square.
Here are the messages your program should print to the standard output:
Here are the error messages; all are to be printed on the standard error:
If the program reads an end of file at the prompt, print a newline and quit.
The program should exit with an exit status code of 0.
Please call your program ttt4a.c and submit it through Gradescope. A sample executable, used to generate the Gradescope validation outputs, is available on the CSIF at /home/bishop/hw4/ttt4a.
Please call your program ttt4b.c and submit it through Gradescope. A sample executable, used to generate the Gradescope validation outputs, is available on the CSIF at /home/bishop/hw4/ttt4b.
Now, breathe deeply and calm down. We will do this in steps; you only have to turn the final program in to Canvas (not Gradescope).
int bday[] = { 1, 2, 3, 4, 5, 5, 2 };then hasduplicates(bday) returns 1 and if
int bday[] = { 1, 2, 3, 4, 5, 6, 7 };then hasduplicates(bday) returns 0.
For 2 people, the probability of 2 birthdays in common is 0.001400 For 3 people, the probability of 2 birthdays in common is 0.006600 For 4 people, the probability of 2 birthdays in common is 0.015200 For 5 people, the probability of 2 birthdays in common is 0.025400 For 6 people, the probability of 2 birthdays in common is 0.041400 For 7 people, the probability of 2 birthdays in common is 0.053000 For 8 people, the probability of 2 birthdays in common is 0.082000 For 9 people, the probability of 2 birthdays in common is 0.092200 For 10 people, the probability of 2 birthdays in common is 0.121800Hint: Don’t be surprised if your probabilities are slightly different than the ones shown in the sample output. As randomness is involved, it is very unlikely your numbers will match the ones shown here.
To turn in: Please call your program bday.c and submit it through Canvas (not Gradescope). A sample executable is available on the CSIF at /home/bishop/hw4/ttt4b.
|
ECS 36A, Programming & Problem Solving Version of May 30, 2024 at 3:58PM
|
You can also obtain a PDF version of this. |