You are daydreaming in the middle of a lecture. Are you actu…

Questions

Yоu аre dаydreаming in the middle оf a lecture. Are yоu actually thinking?

Descriptiоn оf the prоgrаm to write: Uploаd а .c source file containing a main function that will implement the following program. Your program will implement a text-based game that the user plays against the computer. Both the player and the computer start with 10 points. During a round of the game, the player starts by entering an integer value. This value is normally between 1 and 3 included. However, since it is meant to be subtracted to the points that the player has, they cannot enter a value greater than the number of points they have left. For instance, if a player has only 2 points left, then they can only enter a value between 1 and 2 instead of 1 and 3. Once a valid value has been entered (see below for how to handle invalid input), the computer generates a random integer value, also between 1 and either 3 or whatever the number of points it has left is if it is below 3. For instance, the computer has 10 points left, they will generate a random number between 1 and 3. If they had only 1 point left, they would have to generate a random number between 1 and... well... 1.  The winner of the round is whoever has entered the largest value. If both values are the same, then no one wins. When the player wins a round, their score is incremented by one (starting at 0 at the beginning of the game).  As soon as either the computer or the player run out of points, the game ends and the player's score is displayed. The score is computed by adding the actual score to the number of points the player has left.  See the example of program's execution section below for more details about the requirements. Example of Program's Execution (user input is in bold) In the following game, the player always enters the value 3 thus scoring quite a few times against the computer but ending up using all their points first and therefore not receiving any bonus at the end. Game starting...Player: Score is 0 Points remaining: 10 Enter value: 0 ERROR: enter values between 1 and 3 included. Enter value: 4 ERROR: enter values between 1 and 3 included. Enter value: 3Computer: Points remaining: 10 Value played: 2Player wins this round!Player: Score is 1 Points remaining: 7 Enter value: 3Computer: Points remaining: 8 Value played: 2Player wins this round!Player: Score is 2 Points remaining: 4 Enter value: 3Computer: Points remaining: 6 Value played: 3Draw! No one wins this round!Player: Score is 2 Points remaining: 1 Enter value: 3 ERROR: you do not have enough points. Enter value: 0 ERROR: enter values between 1 and 3 included. Enter value: 1Computer: Points remaining: 3 Value played: 3Computer wins this round!Player's Final Score is 4 + 0 = 4 2nd Example of Program's Execution (user input is in bold) In the following game, the player always enter a value of 1. They do not score any points by winning rounds, but they are left with quite a few points at the end which are added to their score. Game starting...Player: Score is 0 Points remaining: 10 Enter value: 1Computer: Points remaining: 10 Value played: 2Computer wins this round!Player: Score is 0 Points remaining: 9 Enter value: 1Computer: Points remaining: 8 Value played: 2Computer wins this round!Player: Score is 0 Points remaining: 8 Enter value: 1Computer: Points remaining: 6 Value played: 3Computer wins this round!Player: Score is 0 Points remaining: 7 Enter value: 1Computer: Points remaining: 3 Value played: 3Computer wins this round!Player's Final Score is 0 + 6 = 6 Grading Criteria: Rubric # Pts Additional Grading Notes The program compiles without compilation errors or warnings 3 Deduct 1 point per minor compilation error (e.g., typo, forgotten semi-colon, forgotten or extra curly braces or parentheses). If the program does not compile due to too many errors or due to an error that is non-trivial to fix (see above), then the whole assignment receives zero points. The program executes without crashing at runtime 3 Deduct one point for each use case that leads the program to crash (maximum 3) Invalid values entered by the user are detected and an appropriate error message is displayed before to re-prompt the user for a value. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The player's score is correctly calculated during each round and at the end of the game. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The winner of each round is correctly identified and a corresponding message displayed. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The control flow of the program is appropriate, given the rules of the game. 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented The program displays and behaves the same way than illustrated in the above examples of program's execution sections 3 3 – Implemented according to requirements 2 – Mostly properly implemented 1 – Not properly implemented 0 – not implemented Total 21