Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DO NOT USE ARRAYS AND USE ECLIPSE. DO NOT EVEN LOOK AT THIS IF YOU ARE GOING TO USE ARRAYS OR USE A DIFFERENT PLATFORM

DO NOT USE ARRAYS AND USE ECLIPSE. DO NOT EVEN LOOK AT THIS IF YOU ARE GOING TO USE ARRAYS OR USE A DIFFERENT PLATFORM OTHER THAN ECLIPSE. PLEASE FOLLOW THE PROJECT GUIDELINES. THIS IS THE 6TH TIME I HAVE POSTED THIS. Please read the following snippets and write a C++ program using Eclipse that satisfies the requirements in the problem/project 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. This program can NOT use arrays. Please follow all design requirements. 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

image text in transcribed

Learning Objectives: The intent of this programing project is to allow you the opportunity to demonstrate your ability to solve problems using procedural C++ programming. This project will focus on using loops, functions random numbers, and the correct use of global variables in the implementation of the Tic-Tac. Toe game. in the implementation of Program Description: In this design project, you will implement a Tic-Tac-Toe game between a user and the computer. Tic- Tac-Toe is a game that two parties play taking turns to mark a space (with X and O) in a 3x3 board. The player wins who succeeds to put three marks on a line (horizontal, vertical, on diagonal). Design Specifications: Basic Implementation For the basic implementation, the user is the first player and the computer is the second player. Additionally, the user gets the marker 'X' and the computer gets the marker 'O'. To receive full credit for the basic implementation, you must meet the following design specifications: Function to draw the tic-tac-toe boarad The Tic-Tac-Toe game requires a function that draws the Tic-Tac-Toe board. This function will get called repeatedly until either all the nine spaces on the board have been played or a player wins Initially, the nine spaces will have numbers associated with their position, as shown in the screen shot below. After each play, the chosen space will show either an X or an O to designate the space was taken Welcome to the game of Tic Tac Toe Below you will indicate your position 9) as shown in the table Tic Tac Toe User (x)Computer (o) Note: The first two lines print a welcome message, which should NOT be a part of the function to draw the Tic-Tac- Toe board. 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 Below you wil indicate your position (1-9) shown in the table Tic Tac Toe User (x) Computer (0) Enter your position: 0 Invalid input: the position indicator has to be betueen 1 and 9 Enter your position: 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 r' 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 Tic Tac To User (X) . Computer (0) Enter your position: Invalid input: Pooition already occupied Enter your pooition:3 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 on the top row. Therefore the user is a winner, which is displayed and the program is terminated. Enter your position: 3 Tic Tac Toe User (x)Computer (o) Player 1 wins the game Create a main0 program main) will 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 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. . Create a .h file that contain the function prototypes. Include .h file into the main.cpp file. Documentation 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 as needed to demonstrate that the program submitted meets the project's design specifications. TEST YOUR CODE!!!! . 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. Learning Objectives: The intent of this programing project is to allow you the opportunity to demonstrate your ability to solve problems using procedural C++ programming. This project will focus on using loops, functions random numbers, and the correct use of global variables in the implementation of the Tic-Tac. Toe game. in the implementation of Program Description: In this design project, you will implement a Tic-Tac-Toe game between a user and the computer. Tic- Tac-Toe is a game that two parties play taking turns to mark a space (with X and O) in a 3x3 board. The player wins who succeeds to put three marks on a line (horizontal, vertical, on diagonal). Design Specifications: Basic Implementation For the basic implementation, the user is the first player and the computer is the second player. Additionally, the user gets the marker 'X' and the computer gets the marker 'O'. To receive full credit for the basic implementation, you must meet the following design specifications: Function to draw the tic-tac-toe boarad The Tic-Tac-Toe game requires a function that draws the Tic-Tac-Toe board. This function will get called repeatedly until either all the nine spaces on the board have been played or a player wins Initially, the nine spaces will have numbers associated with their position, as shown in the screen shot below. After each play, the chosen space will show either an X or an O to designate the space was taken Welcome to the game of Tic Tac Toe Below you will indicate your position 9) as shown in the table Tic Tac Toe User (x)Computer (o) Note: The first two lines print a welcome message, which should NOT be a part of the function to draw the Tic-Tac- Toe board. 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 Below you wil indicate your position (1-9) shown in the table Tic Tac Toe User (x) Computer (0) Enter your position: 0 Invalid input: the position indicator has to be betueen 1 and 9 Enter your position: 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 r' 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 Tic Tac To User (X) . Computer (0) Enter your position: Invalid input: Pooition already occupied Enter your pooition:3 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 on the top row. Therefore the user is a winner, which is displayed and the program is terminated. Enter your position: 3 Tic Tac Toe User (x)Computer (o) Player 1 wins the game Create a main0 program main) will 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 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. . Create a .h file that contain the function prototypes. Include .h file into the main.cpp file. Documentation 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 as needed to demonstrate that the program submitted meets the project's design specifications. TEST YOUR CODE!!!! . 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

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

More Books

Students also viewed these Databases questions