Design program that allow player to play game of tic-tac-toe

Assignment Help Programming Languages
Reference no: EM131119475

Tic-Tac-Toe Game

Design a program that allows two players to play a game of tic-tac-toe. Use a two dimensional String array with three row and three columns as the game board. Each element of the array should be initialized with an asterisk (*). The program should run a loop that does the following;

a. Displays the contents of the board array.

b. Allows player 1 to select a location on the board for an X. The program should ask the user to enter a row and column number.

c. Allows player 2 to select a location on the board for an O. The program should ask the user to enter the row and column number.

d. Determines whether a player has won or if a tie has occurred. If a player has won, the program should declare that player the winner and end. If a tie has occurred, the program should say so and end.

e. Player 1 wins when there are three Xs in a row on the game board. Player 2 wins when there are three Os in a row on the game board. The winning Xs or Os can appear in a row, a column, or diagonally across the board. A tie occurs when all of the locations on the board are full, but there is no winner.

Reference no: EM131119475

Questions Cloud

How would you classify the estimated sales returns stemming : Does the proposed plan achieve the goals of increasing the current ratio and decreasing the debt to equity ratio?
Explain why these social responsibility activities : It has been argued that shareholder wealth maximization is not a realistic normative goal for the firm, given the social responsibility activities that the firm is “expected” to engage in (such as contributing to the arts, education, etc.). Explain w..
Determine your approach would not work for every country : Propose one strategic idea that could launch a regionally famous American product into the global market. Provide two examples to support your idea, and determine whether your approach would or would not work for every country. Support your respon..
Analyzing results of a marketing strategy : Please answer the following questions in a 3-5 page paper (include additional title and references pages) and include APA format and citation style with accompanying references:
Design program that allow player to play game of tic-tac-toe : Design a program that allows two players to play a game of tic-tac-toe. Use a two dimensional String array with three row and three columns as the game board.
Is the shareholder wealth maximization goal a short or long : Is the shareholder wealth maximization goal a short- or long-term goal? Explain your answer.
How many days before the hurricane arrives : Imagine a Category 5 strength hurricane is heading toward Long Island in New York. How many days before the hurricane arrives must the mandatory evacuation order be issued so that all of the people are able to get off the island?
Can corporate morality be practical : An organization's goals often include being a good corporate citizen by emphasizing ethical and socially responsible decisions and actions. What happens when an organization's values are continually on public display? What are the ethical implication..
Discuss the accounting alternatives that should be considere : Discuss the accounting alternatives that should be considered by Griseta & Dubel Inc. for the recognition of its revenues and related expenses.

Reviews

Write a Review

 

Programming Languages Questions & Answers

  Write an arm subroutine which allocate memory for new string

Prepare an ARM subroutine which will extract a substring from a string and you will need to use the library routine malloc to allocate memory for the new string - CS252 Programming Assignment

  Create generic stack class called mystack to place furniture

Application to simulate distributing furniture from Whole sale center to different stores -  Write an application to simulate distributing furniture from Whole sale center to different stores.

  Create a c# console application project

Within the namespace and outside of the wrapper class for Main create a class named assignment8 that inherits from System.Windows.Forms.

  Use a switch statement to calculate a letter grade

Use a switch statement to calculate a letter grade based on a numeric average up to 100. Allow the numeric score to be entered in a text field. A Grade button will display the corresponding letter grade in a label.

  Write program that allow a user to enter stuin thident names

Write a program that would allow a user to enter stuIn thident names and Final grades (e.g. A,B,C,D,F) from their courses. You do not know how many students need to be entered.

  Write program to compute salary of employee

Write a program to compute the salary of an employee according to his/her grade assigned by employer. You should declare class named CalSalary whose private data members will be employee.

  Calculate the area and perimeter of a rectangle

Design and write a program, using functions, that calculates the area and perimeter of a rectangle whose dimensions (length and width) are provided by a user.

  Read data from a file into our program and search by title

I need help getting the data from the data file to work correctly with the program. Please see the attached documents.

  Program to display employees-total hours in decreasing order

The following array stores work hours for eight employees, write program which display employees and their total hours in decreasing order of total hours.

  What flash and html5 can and cannot do

Provide recommendations for developers ­in terms of developing within and between each platform.

  Explain different kind of product sold

Use two-dimensional array to solve following problem. Company has four salespeople(1 to 4) who sell five different products (1 to 5). Once day, each salesperson passes slip for each different kind of product sold.

  Calculate the sum of squares of numbers using for loop

Given int variables k and total which have already been declared, use for loop to calculate the sum of squares of first 50 counting numbers, and store this value in total.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd