Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

b. Allow the user to enter in the numberof sticks in the initial pile and the ma

ID: 3615676 • Letter: B

Question

b.     Allow the user to enter in the numberof sticks in the initial pile and the maximum number of sticks aplayer can pick up in a turn.

c.      The user will play against thecomputer. Use the random number generator to calculate thecomputer’s selection.

d.     If there are fewer than 5 sticks, thecomputer should select all of the sticks in order to win!

Requirements:

a.      The main program must besmaller than 10 lines long (not including comments)

b.     Make sure to display a welcomemessage describing the rules of the game to the user

c.      Allow the user to decide ifthey are going first, or if the computer is going first.

d.     If the user enters in an invalidvalue (negative, or greater than 4), then they should be givenanother chance

e.      Allow the user to play the gameover and over until they are done or finallywin!

f.      Graphics: For Extra credit,allow the user to select the pieces using the mouse!

g.     Or, on Unix or forMac users: For Extra credit: Addanother player (2 players and the computer)!

Explanation / Answer

//Hope this will helpyou. #include using namespace std;int ch,pile;void play(int n){int m=0;if(n==1){do{coutm;}while(m4);pile -=m;}while(1){cout