IN C++ Write a program that implements the game tic-tac-toe: Tic-Tac-Toe is a game played on a three-by-three board. Two players, X and O, alternate in placing their respective marks in the cells of this board, starting with player X. If either player succeeds in getting three of his or her marks in a row, column, or diagonal, then that player wins. In this homework, you should use the OOP concepts to implement the tic-tac-toe game.
Q: What are the distinctions between Sqoop, flume, and distcp?
A: Answer: Distcp and Sqoop are used to transfer the data. Using Sqoop, you may migrate any kind of da...
Q: d) Suppose you have used machine learning techniques to develop two alternative models designed to d...
A: Machine Learning's main goal is to utilize computers to learn knowledge without being specifically t...
Q: What exactly is MEMS storage?
A: Introduction: What is the MEMS storage concept? MEMS storage is used in the construction of tiny in...
Q: Intel's Pentium CPU has a man to thank for that.
A:
Q: In a terabyte, what is the number of gigabytes
A: The terabyte is often used to refer to storage capacity or the quantity of data saved. Tera derives ...
Q: Use Dictionary and tupples to solve the problems in PYTHON. Thank You <3 Write a python program whi...
A: ALGORITHM:- 1. Take user input for the elements. 2. Insert them in array. 3. Find the frequency of e...
Q: Let's try to find out whether a year has 365 or 366 days. To do this, we need to create a leap year ...
A: #include <stdio.h> int isLeapYear(int); int main(){ int year=0; printf("Enter year: "); ...
Q: A CD ROM is a computer's read-only removable storage medium on a compact disc.
A: A CD-ROM is capable of playing audio files but it is non deletable. It can store data as well. It is...
Q: 1. Question: You have sub-netted your class C network 192.168.1.0 with a subnet mask of ...
A: 1) Given data IP address- 192.168.1.0 /28 subnet mask = 255.255.255.240 number of subnets =16 numb...
Q: Define the following terms and answer the questions 10. Disk quotas
A: Note: This is a multiple-question-based problem. As per company guidelines, only the first question ...
Q: n FIFO page replacement algorithm, when a page must be replaced ______ Select one: a.newest page is ...
A: intro In FIFO page replacement algorithm, when a page must be replaced ______ Select one: a.newest...
Q: You are configuring a connection between two backbone switches, and you want to make sure the conne...
A: Round-robin DNS is a load balancing technique where the balancing is done by a type of DNS server ca...
Q: Primary 0.S. interstate nighways are numbered 1-99. Odd numbers (like the 5 or 95) go north/soutn, a...
A: Code : ------------------------- number = int(input()) if(number <= 0 or number > 999): p...
Q: Write a Bash script that takes a list of numbers as arguments. The output is the sum of the numbers.
A: The answer is
Q: Analyze the following Java codes. What is the output if the code is executed? þackage javaapplicatio...
A: Try catch block is used to handle Exception raised in programming languages. Exception forces progra...
Q: 3. Find an nfa that accepts the language L (aa (ab + b)). 4. Find an nfa that accepts the language L...
A: Designed the NFA for the given regular expression
Q: What is cloud computing, and what are the three types of cloud services in cloud computing?
A: Introduction: Cloud computing is the use of internet technology to deliver/enable scalable, extendab...
Q: What is the purpose of normalization? (in designing database) Explain the difference between 2NF a...
A: Ans 1- An approach for organizing data in a database is normalization. A database must be ...
Q: h2: h1(key) = key mod m h2 (key) = {key mod (m-1)} + 1 Insert the keys {22, 1, 13, 11, 24, 33, 18, 4...
A: Chaining : In chaining, all the values having same hash function value are stored as a linked list...
Q: Draw the graph for the following adjacency matrix.
A:
Q: Using the algorithm described in Section 4.4.2, remove direct left recursion form the following gram...
A: Step 1: Left recursion occurs when the terminal derives any string starting with the same terminal f...
Q: Create a recursive algorithm to compute the product of two positive integers, m and n, using only ad...
A: import java.util.*;class Main { static int productOfTwoIntegers(int n1, int n2){ if (n1 < n2) ...
Q: I am a business analyst working on a billing system, which statement best describes my role?
A: Answer Computer Aided Design Explanation: Umbrella Business Intelligence is basically a process of...
Q: What file types does Sqoop support when it comes to data import?
A: Swoop imports data using two different file types. There are two types of test files: delimited test...
Q: Compute for the necessary value of the prescaler in order to order to develop a 1ms delay. Use XTAL ...
A: SUMMARY: -Hence, we discussed all the points.
Q: four_dice = np.zeros(Lpow(6,4),5]) n = 0 outcomes = [1,2,3,4,5,6] for i in outcomes: for j in outcom...
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: What is the aim of an organization's information security? What advantages does data security provid...
A: The aim of an organization's information security is to protect the information and systems that sup...
Q: 21. Write a JAVASCRIPT code to find the sum of all multiples of 5 and 7 less than 1000 in the output...
A: Write a JAVASCRIPT code to find the sum of all multiples of 5 and 7 less than 1000 in the output.
Q: apter 26 – Exercise 2 from book Database and Application Security by Bhavani Thuraisingham Develop a...
A: The term "workflow" describes a work process that consists of several individual and often repeatabl...
Q: 2. Using conditional statements in Javascript sort the numbers -5, 6, 2 and display the sorted numbe...
A: JavaScript Code for above : var a = -5;var b = 6;var c = 2;if(a>b && a>c){ if(b...
Q: security
A: Introduction: Cloud Storage Providers (CSPs): In computer science, cloud storage providers (CSPs) pr...
Q: 5. Define a function in PHP language that takes a sorted list as the parameter and returns a list af...
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: A method is implemented to compute a formula that involves dividing a quantity by a variable y. If ...
A: For the 1st solution then it will throw an error at the very beginning of the code and thus rest of ...
Q: 7. Let M = ({90: 91; 42}, {a, b}, ô, qo; {42}) be the DFA with transition table: a | b qo 90 91 q1 9...
A:
Q: List numbers 1-10 to the nodes of the binary tree in the order that a preorder traversation visits (...
A: The answer is
Q: at using DRB is more efficient th
A: Do you think that using DRB is more efficient than using SRB
Q: I need to write a Java program to count the number of muck-free regions in a lagoon. The Lagoon is r...
A: Solution int main() { memset(vis,0,sizeof(vis)); memset(q,0,sizeof(q)); memset(g,0,sizeof(g)); c...
Q: Convert the following ER diagrams into relational schemas
A: Here we have three entities ie Painting, Artist and Museum. The relationship DoneBy and Exhibits is ...
Q: If an express application contains the following call to getg: app.get('/foo', (req, res) => res.sen...
A: The answer is
Q: Which of the following ports would be used during a domain name lookup? a. 22 b. 23 c. 53 d. 110 e. ...
A: When we want to program a server application, we need to specify a port on which it will listen. So ...
Q: For a "word" of 3 bits, make a table that lists all the signed binary numbers representable by the f...
A: ans is given below
Q: Create a Truth Table and draw the logic circuit for (p ∨¬r) ∧ (¬p ∨ (q ∨¬r)).
A: A truth table is a logical table that determines whether or not a compound assertion is true. Combin...
Q: III. Draw the logic circuit of the proposition pAqAr
A: here we need to answer part 3: given proposition = ¬p∧q∧r for the given proposition we need the log...
Q: bläi 3 correct the following program and what the output of inches when the user input data is * .[f...
A: After fixing the code Where the problem was with the class name, the code used distance instead of D...
Q: A cempater with a teletype as an I/O device has the following I/O registers INPR: Input Register - 8...
A: Actually, registers are used to stores the data/information.
Q: Critically evaluate the usability of two websites from UK-based universities with...
A: The answer is given below.
Q: I need Entity Relationship Diagram (EER diagram) of Examination Hall Ticket Management System ... In...
A: ER diagram stands for Entity Relationship diagram.
Q: What are the four types of bus arbitration?
A: Bus Arbitration is known as the process that is having the master that can access the current bus an...
Q: Write a C program to perform following operation on Circular LinkedList: Create() - Create a Circu...
A: C is a programming language built in the early stages and also used for creating data structures. He...
Q: Write a Java program to solve the problem. Use BufferedReader as means of input. Problem: The third...
A: BufferedReader is a type of class in java that reads text lines from the input stream. It buffers th...
Computer Science
IN C++
Write a program that implements the game tic-tac-toe: Tic-Tac-Toe is a game played on a three-by-three board. Two players, X and O, alternate in placing their respective marks in the cells of this board, starting with player X. If either player succeeds in getting three of his or her marks in a row, column, or diagonal, then that player wins. In this homework, you should use the OOP concepts to implement the tic-tac-toe game.
Step by step
Solved in 4 steps
- Transcribed Image Text JAVA Programming Problem: In the game of "Assassin's Creed", you control a ship with a cannon which is attacking a large enemy Assassin's Creed, armed with many guns. Your goal is to destroy as many of the guns as possible. The battle field is a 2D Cartesian grid, where your cannon is located at the origin. The enemy Assassin's Creed is a horizontal line segment located from the coordinates (X1, Y) to (X2, Y). There are exactly (X2 - X1 + 1) guns on the ship, located at the integer points (X1, Y), (X1+1, Y), ..., (X2, Y). However, the problem is, you cannot always fire at a gun. There are supernatural rocks located at all points of the battlefield whose X and Y coordinates are both integers. In order to fire successfully at an enemy's gun, the line connecting your cannon and that gun must not go through any rocks. Develop a JAVA code to output the number of the enemy battleship's guns that your cannon can destroy. Test Case Result 1 2 2 -2HASKELL PROGRAMMING LANGUAGE QUESTION PLEASE Rock-paper-scissors is a game for two players. Each player chooses an action without knowledge ofthe other’s choice. If the players choose the same action then there is a draw. Otherwise the winneris determined by the following rules: paper beats rock, rock beats scissors, and scissors beats paper.you are going to make a playable Rock-Paper-Scissors game and consider multiplayer tournaments • Please put comments in your code to show what you are answering with each piece ofcode. • You may create auxiliary functions if you like. You may use library functions from Haskell’sstandard library.• Please limit your line lengths to 100 characters max. Please use the following two data types which you can copy-and-paste into your code.data Action = Rock | Paper | Scissors deriving (Eq, Show)data Outcome = Player1Win | Player2Win | Draw deriving ShowAction represents a player’s chosen action and Outcome represents the outcome of playing a game…In C programming language write Task 2: Hangman gameWrite a terminal based on the game of Hangman. In a hangman game, the player is given a wordthat they need to guess, with each letter of the word represented by an underscore/blank. Theplayer tries to guess a letter of the word by entering it into the terminal. If the letter is correct, theblank corresponding to that letter is filled in. If the letter is incorrect, a part of a stick figure isdrawn. The player has a limited number of incorrect guesses before the stick figure is fully drawnand the game is lost. The player wins the game if they guess all the letters of the word before thestick figure is fully drawn.The program should have an array of possible words to choose from. A different word should berandomly chosen from the array every time we run the program.Others: Do not use GOTO statements
- JAVA CODE PLEASE THANK YOU Rectangle by CodeChum Admin A rectangle can be formed given two points, the top left point and the bottom right point. Assuming that the top left corner of the console is point (0,0), the bottom right corner of the console is point (MAX, MAX) and given two points (all "x" and "y" coordinates are positive), you should be able to draw the rectangle in the correct location, determine if it is a square or a rectangle, and compute for its area, perimeter and center point. To be able to do this, you should create a class for a point (that has an x-coordinate and a y-coordinate). Also, create another class called Rectangle. The Rectangle should have 2 points, the top left and the bottom right. You should also implement the following methods for the Rectangle: display() - draws the rectangle on the console based on the sample area() - computes and returns the area of a given rectangle perimeter() - computes and returns the perimeter of a given rectangle…The Spider Game Introduction: In this assignment you will be implementing a game that simulates a spider hunting for food using python. The game is played on a varying size grid board. The player controls a spider. The spider, being a fast creature, moves in the pattern that emulates a knight from the game of chess. There is also an ant that slowly moves across the board, taking steps of one square in one of the eight directions. The spider's goal is to eat the ant by entering the square it currently occupies, at which point another ant begins moving across the board from a random starting location. Game Definition: The above Figure illustrates the game. The yellow box shows the location of the spider. The green box is the current location of the ant. The blue boxes are the possible moves the spider could make. The red arrow shows the direction that the ant is moving - which, in this case, is the horizontal X-direction. When the ant is eaten, a new ant is randomly placed on one of the…Computer Science I need the code for this in Alice programming Faery Magic Create a world that has at least 5 different objects from the Furniture Gallery and one Faery from the Fantasy/Faeries Gallery. The Faery has the power to make an object disappear. Everything that the faery touches disappear from the scene. Create an interactive game where the user can click one object at a time from the scene; then, the faery faces that object and moves toward it. Write a recursive method named CheckDistance, that checks whether the faery is very close to the object clicked by the user. If it is, the faery bends over to touch the object. After the faery touches the object, the object disappears (this is the base case of the recursion). If the faery is not yet close enough to the object to be able to touch it, the faery moves a small distance forward and the CheckDistance method is recursively called (this is the recursive case of the recursion). Include instructions for the game that appears…
- 1. Astronomy Board Game In an astronomy board game, N planets in an imaginary universe do not follow the normal law of gravitation. All the planets are positioned in a row. The planetary system can be in a stable state only if the sum of the mass of all planets at even positions is equal to the sum of the mass of planets at the odd positions. Initially, the system is not stable, but a player can destroy one planet to make it stable. Find the planet that should be destroyed to make the system stable. If no such planet exists, then return -1. If there are multiple such planets, then destroy the planet with the smallest index and return the index of the destroyed planet. Example Let N=5 and planets = [2,4,6,3,4]. Destroying the fourth planet of mass 3 will result in planets= [2,4,6,4], and here, the sum of odd positioned planets is (2+6)=8, and the sum of even positioned planets is (4+4)=8, and both are equal now. Hence, we destroy the fourth planet. Function Description Complete the…Tic-Tac-Toe For this question, you will be implementing a simple Tic-Tac-Toe game without the graphics. Here is how it works: • First, it is randomly determined if the user starts the game or the computer and this information is shown to the user. The player who starts always starts as "X". • The players (computer and the user) will then take turns in playing. The computer will choose a random empty spot on its turn. The user enters its choice in the console. • Each of the empty spots have a corresponding number that the players choose on their turn. If the user enters anything other than the number of an empty spot (not yet filled with "X" or "O"), it will not be accepted, and they will be prompted to enter a correct number. 2 4 7 8 • After each turn, two things need to be done: 1) displaying the updated board 2) checking if anyone has won (it should be printed who has won – the user or the computer). The game goes on until someone wins or until all the 9 empty spots are filled and no…Monty Hall Problem – Coding Lab In this lab, you will write a code that simulates the Monty Hall Game Show. Thegame host gives the participant the choice of selecting one of three doors. Twodoors has a goat behind them and one door has a prize. The set of choices arerandomized each round. The participant needs to select the door with the prizebehind it. When the participant selects a door, the game host reveals a door with agoat behind it. The game host opens a door (different from the one selected by theparticipant) that has a goat behind it. The participant is then given the option tochange their choice. When you run your code, the code would display a message prompting the user toinput their door choice, labelled as 1, 2, and 3. Then the code will display a doornumber (different from the one the user picked) with a goat behind it and ask theuser if they would like to change their choice. The code then displays a message onwhether the user guessed the correct door. The game then…
- Computer Science C# Programming Object Orientation Please use Arrays or ArrayLists where appropriate Implement a menu driven program that has some operations for a food truck. A food truck has multiple food items as well as a menu which contains a selection of the food items which will be sold for that day. A maximum of 10 food items can appear on the menu for any day. For each food item keep a code, description, category, price and quantity in stock (code, description and category are not usually changed). Create a comma delimited text file called "items.txt" for 15 or more food items, indicating the item's description, category, price and quantity in stock. Read all the food items from the text file “Items.txt” Display all the food items available for this food truck. Continuously prompt the user for a food item’s code to be placed on the menu until the menu is full or the user enters -1. Note that only food items which have a positive quantity in stock may be added to…C++ A dice game called "21" It is a variation on BlackJack where one player plays against the computer trying to get 21 or as close to 21 without going over. Here are the rules of the game: You will play with dice that have numbers from 1 to 11. To win, the player or the computer has to get to 21, or as close as possible without going over. If the player or computer goes over 21, they instantly lose. If there is a tie, the computer wins. Starting the game: The player is asked to give the computer a name. For now, we'll simply call the computer opponent, "computer." The game starts with rolling four dice. The first two dice are for the player. These two dice are added up and the total outputted to the screen. The other two dice are for the computer. Likewise, their total is outputted to the screen. Player: If a total of 21 has been reached by either the player or the computer, the game instantly stops and the winner is declared. Otherwise, the player is asked if they…Write in C language Description Gomoku, also called Five in a Row, is an abstract strategy board game. It is traditionally played with black and white stones on a 19×19 board.The winner is the first player to form an unbroken chain of five stones horizontally, vertically, or diagonally. Please write a program to determine if there is a winner or not. Input Input content 19 line, each line content 19 character and a new line O represent white stone, X represent black stone and _ means there is no stone on that spot. Output Output "White" if white win, "Black" if black win, "No winner" if no one win.