Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please read the following snippets and write a C++ program using Eclipse that satisfies the requirements in the problem description. Please choose either Better Implementation

Please read the following snippets and write a C++ program using Eclipse that satisfies the requirements in the problem description. Please choose either "Better Implementation" or "Best Implementation" to write the program and complete the required steps for the desired entry. Please be sure to use Eclipse (not java or some other platform) and please be sure to include a readable version of your output. Thank you.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Welcose to the gane of Tic Tac Toe Bolow you will indicate your position (1 9) as shown in the teble Tic Tac Toe User (x) Conputer (o) Note: The finst wo lines print a velcome message, hich hould NOT be a part of the function te dras the Tie-Tae- Toe beard. Enter your pooition Function to check the input is within the valid range As a Tic-Tac-Toe board has only 9 spaces, if the input value is less than 1 or greater than 9 then an error message should be displayed (for example, "Invalid input: the position indicator has to be in the range of 1 to 9", as shown in the screen shot below). This error checking should be performed every time the user enters a number Function to check the designated space is available After passing the input validation test, the program has to check if the designated space is available. Create a function to examine whether the selected space is available. Use the fact that the occupied space (which were previously played) have either 'X' or 'O character instead of the space number (1 through 9). When the selected space is available, mark it with "X' or 'O'; if not, either ask the user to enter another number (as shown in the example below) or pick another random space (when it is the computer's turn to play). In the example below, the space "6" that the user designates is already taken. The character "O" in the space means that the computer placed the marker there. Therefore, the program asks the user to enter another value, and this time the user enters "3", whose corresponding space is available. Computer plays at position 9 Tie Tae Toe Jeer (x) Coputer (o) Enter yaur position Invalid input: Position already oeeupted Enter your position Function to check ifwe have a winner (and the program should end) Whenever a new space is marked, the program should check whether there is a winner. If there is a winner, the winner is displayed and the program is terminated. If not, it will continue to play. In the example below, there are unplayed slots left (4, 5, 7, 8) but there are three X's orn the top row. Therefore the user is a winner, which is displayed and the program is terminated. Enter your position Tic Tac To Ueer (x)Cosputer (0) Player 1 wins the gase Create a main)program mainO wil1 play the complete Tic-Tac-Toe game including all the fore mentioned functions. Other functions may be added as needed but are not required. NOTE: This design cannot use arrays Better Implementation To receive full credit for the better implementation, you must meet the following design specifications . Ask the user to flip a coin to determine who (either the user or the computer) should play first. . Ask the user to choose their own marker, between 'X' and O Best Implementation To receive full credit for the best implementation, you must meet the following design specifications: Create a separate cpp files for each function. ete a .h file that contain the function prototypes. Include h file into the main.cpp file. Documentationn Source Code A fully commented and properly formatted CPP source file for your final design. You only need to submit the source file for the highest level implementation you've completed (i.e. basic, better, best) The implementation level MUST be stated in the program description. .Please refer to the C++ Style Guide for proper formatting, commenting and variable naming Documentation: A single word file containing examples of the program executing. Use the Window's snipping tool (or similar tool) to obtain and size screen-shots of the program executing. For each example, provide a brief description of what is being demonstrated. Be sure to include an explanation of any discrepancies between the expected results and the actual results you obtained. You should include as many examples meets the project's design specifications. TEST YOUR CODE!!!! * les as needed to demonstrate that the program submitted Presentation You will need to give a brief (5-7 minute) code review of your solution. A code review is a systematic examination of your program's source code. It is intended to find and fix mistakes overlooked in the initial development phase, improving both the quality of software and the developers' skills. Your presentation should cover the following topics .Execute your program and demonstrate that it produces the correct output. . Present your code and discuss your solution. Discuss any problems encountered and how you solved them. Review how you tested your code Welcose to the gane of Tic Tac Toe Bolow you will indicate your position (1 9) as shown in the teble Tic Tac Toe User (x) Conputer (o) Note: The finst wo lines print a velcome message, hich hould NOT be a part of the function te dras the Tie-Tae- Toe beard. Enter your pooition Function to check the input is within the valid range As a Tic-Tac-Toe board has only 9 spaces, if the input value is less than 1 or greater than 9 then an error message should be displayed (for example, "Invalid input: the position indicator has to be in the range of 1 to 9", as shown in the screen shot below). This error checking should be performed every time the user enters a number Function to check the designated space is available After passing the input validation test, the program has to check if the designated space is available. Create a function to examine whether the selected space is available. Use the fact that the occupied space (which were previously played) have either 'X' or 'O character instead of the space number (1 through 9). When the selected space is available, mark it with "X' or 'O'; if not, either ask the user to enter another number (as shown in the example below) or pick another random space (when it is the computer's turn to play). In the example below, the space "6" that the user designates is already taken. The character "O" in the space means that the computer placed the marker there. Therefore, the program asks the user to enter another value, and this time the user enters "3", whose corresponding space is available. Computer plays at position 9 Tie Tae Toe Jeer (x) Coputer (o) Enter yaur position Invalid input: Position already oeeupted Enter your position Function to check ifwe have a winner (and the program should end) Whenever a new space is marked, the program should check whether there is a winner. If there is a winner, the winner is displayed and the program is terminated. If not, it will continue to play. In the example below, there are unplayed slots left (4, 5, 7, 8) but there are three X's orn the top row. Therefore the user is a winner, which is displayed and the program is terminated. Enter your position Tic Tac To Ueer (x)Cosputer (0) Player 1 wins the gase Create a main)program mainO wil1 play the complete Tic-Tac-Toe game including all the fore mentioned functions. Other functions may be added as needed but are not required. NOTE: This design cannot use arrays Better Implementation To receive full credit for the better implementation, you must meet the following design specifications . Ask the user to flip a coin to determine who (either the user or the computer) should play first. . Ask the user to choose their own marker, between 'X' and O Best Implementation To receive full credit for the best implementation, you must meet the following design specifications: Create a separate cpp files for each function. ete a .h file that contain the function prototypes. Include h file into the main.cpp file. Documentationn Source Code A fully commented and properly formatted CPP source file for your final design. You only need to submit the source file for the highest level implementation you've completed (i.e. basic, better, best) The implementation level MUST be stated in the program description. .Please refer to the C++ Style Guide for proper formatting, commenting and variable naming Documentation: A single word file containing examples of the program executing. Use the Window's snipping tool (or similar tool) to obtain and size screen-shots of the program executing. For each example, provide a brief description of what is being demonstrated. Be sure to include an explanation of any discrepancies between the expected results and the actual results you obtained. You should include as many examples meets the project's design specifications. TEST YOUR CODE!!!! * les as needed to demonstrate that the program submitted Presentation You will need to give a brief (5-7 minute) code review of your solution. A code review is a systematic examination of your program's source code. It is intended to find and fix mistakes overlooked in the initial development phase, improving both the quality of software and the developers' skills. Your presentation should cover the following topics .Execute your program and demonstrate that it produces the correct output. . Present your code and discuss your solution. Discuss any problems encountered and how you solved them. Review how you tested your code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What should Belindas and Marcus next steps be?

Answered: 1 week ago