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 c++ program that convert roman no. to decmial

Write C++ program that convert Roman no. to Decmial

  How to program print a one-year reminder list

Have the program print an error message and ignore a reminder if the corrsponding day is negative or larger than 31 (using the continue statement)

  Super call for constructor to allot value of attribute

We have given a super call, which does some work of constructor. Your code must complete constructor by allotting the value of g to gpa attribute.

  Create a function that carries out the desired action

Create your own assignment to get more practice with arrays. Listed below are twenty seven functions you can write that deal with arrays. Listed next to each function is a number of points each is worth in parenthesis. Create a function that carri..

  Write class which accepts user-s hourly rate of pay

Write down class which accepts the user's hourly rate of pay and number of hours worked. Display user's gross pay, withholding tax (15% of gross pay).

  Show the source code for console application

Show the source code for a C# console application named"MyName" that prints your last name, a tab, and then your first name.

  Expression whose value is distance between two point

a structured type with two fields, x and y, both of type double-- write an expression whose value is the distance between the two point represented by p1 and p2.

  Project code in visual studio console application

Project code in visual Studio Console application and class library and the PADI project aims at implementing a simpli ed distributed software transactional system.

  Write program simulate checkout line at supermark

Write the program which simulates checkout line at supermarket. Line is a queue object. Customers( i.e customer objects) arrive in random integer intervals of 1-4 minutes.

  Write pseudocode for determining grade of student

Write a pseudocode for determining the grade of a student given his/her total score. The program should display a grade of A if the score is above 85.

  Explain the principle of programming to an interface

In your own words, explain the principle of programming to an interface. This explanation is meant to help develop your peers' understanding and should be written in as simple terms as possible

  Explaining class with no constructors

How many constructors can a class have? Can you have a class with no constructors? If a class has more than one constructor, which of them gets called?

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