Question: CS18 0.6: ASSIGNMENT #2 - SUPPLEMENT TIC TAC TOE Name 1: Class Day / Time: Due Date: Lab Exercise: Assign. #2 - Supplement Tic Tac

 CS18 0.6: ASSIGNMENT #2 - SUPPLEMENT TIC TAC TOE Name 1:Class Day / Time: Due Date: Lab Exercise: Assign. #2 - Supplement

CS18 0.6: ASSIGNMENT #2 - SUPPLEMENT TIC TAC TOE Name 1: Class Day / Time: Due Date: Lab Exercise: Assign. #2 - Supplement Tic Tac Toe This code will supplement the Tic-Tac-Toe assignment. For the supplement the code does not need to be documented. For the final version of the assignment it should be fully documented, REQUIREMENTS 1. Write a function to read in input for a tic tac toe game (GetAnd Checkinput) - as we done in class. 2. Write a function to initialize the array to all spaces (InitializeBoard). 3. The program should allow the player to make their move by specifying a row and a col. For example if Joe wanted to play in row 3 column 3 the 1/0 would look something like this: What's your play?: 33 4. The function should obtain the input and verify that the row & column # are within range AND that the spot is not taken. 5. It should provide specific feedback (l.e. Row is incorrect, Column is incorrect, Row & Column are both incorrect or spot is taken. 6. Write a main function to test your functions. (you can use DisplayBoard for testing-it is provided in the full assignment). Run the complete test program. 7. Include the following declarations (the constants can be global but the boardAr should be declared in main). const int NUM_ROWS 3; const int NUM_COLS = 3; char boardAr[NUM_ROWSINUM_COLS); 8. Now, modify the previous code segment to obtain two players names and prompt the user by name (GetPlayers). 9. Write a function to prompt the players for entering their names and either assign a token to each player (X or O) or allow them to choose which token they would like to use. 10. The program should allow the player to make their move by specifying a row and a col. For example if Joe wanted to play in row 3 column 3 the I/O would look something like this: "Joe's turn! What's your play?: 33" Turn in on-line (IN THIS ORDER) 1. Your header file 2. The listing of main.cpp 3. A listing of your functions in the order provided within the header file (separate from the main.cpp file) 4. The listing of your print heading function should display above the game instructions 5. The output screen from your test program 1 of 2 LH 0.6: ASSIGNMENT #2 - SUPPLEMENT TIC TAC TOE CS18 Header File for the supplement for the complete header file see the full assignment Gifndef TICTACHEADER #define TICTACHEADER include Hinclude waing namespace std 1/ ADD constants for the number of rows and columns - and use them in the parameters - Thitiboard This function initializes each spot in the board to a space! RETUUS: Board initialized with all spaces void Inithoard (char boardar113) 1/ OUT - tic tac te board Displayboard This function outputs the tic tac to board including the tokens played in the proper format as described below) 2 3 111111 11112111111 1 121111 1212) (21 (3) 131111! 133121! 131 RETURNS nothing outputs the current state of the board ******************************* void Displayboard const char boardar 13) IT - tie tag toe board Play This function prompts the user and get the input for the player's player will contain the name of the player that is using the X token DLAYED WIL WAYS contain the name of the player that is the talen RETURNS the players and through the variables player and playero. *************** void getPlayers strings players. 1/ OUT - player ting player011 OUT - player on Get the input and to check this this documentation to complete veld GetAndCheckinpehar board), char token, string playerX, string players undir / TECTACHEADER 2 of 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!