Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code the following in Java Use may use only the following concepts as needed: Single Dimension Arrays, Multi-Dimension Arrays, Methods, Loops, Post/Pre Fix Operations, Static

Code the following in Java

Use may use only the following concepts as needed: Single Dimension Arrays, Multi-Dimension Arrays, Methods, Loops, Post/Pre Fix Operations, Static vs Non-Static and Random numbers.

Part I

Tic Tac Toe is a very popular game played by many children all over the world. The grid of which the game is played on is like the 2D representation of a multi-dimensional array. You will re-create this game using your knowledge of arrays, methods and loops. The board of the game will be created using a multi-dimensional array. A nested for loop will be used to initialize the multi-dimensional array with the value (a dash). You will have a method for each of the following:

Determine a winner diagonally Determine a winner horizontally Determine a winner vertically Print the game board to the console Change the turn of the player The player move Determine the computer random move Find a resource online that explains how the game is constructed and played. This will be your documentation. Add the link to your comments.

Be sure and comment every line to explain your code.

Part II

Create a programming scenario where the post-fix and the pre-fix operators impact the value of a variable. Using the same scenario, the value of the variable is different when using the post-fix operation versus the pre-fix operation.

Part III

Explain static vs non-static methods. Why we need the key word static for some methods and not for others?

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

=+j Explain the litigation risks in international labor relations.

Answered: 1 week ago

Question

=+j What rules will apply to the process of negotiations?

Answered: 1 week ago