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
- IN C++ USING CLASS Write a program in C++ 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 gameIN HASKELL PROGRAMMING LANGUAGE PLEASE In case you do not know it: the game is played on a 3x3 grid that is initially empty. Two players are playing, by alternatingly making moves. A move by a player places their token (an X for player 1, an O for player 2) into a cell that was empty. We are using algebraic notations for indexing the positions in the board, with A,B,C indexing the columns and 1,2,3 the rows. Specifically, these coordinates would be used in the implementation for moves made by a human player. If the X X O Figure 1: Sample board position same token appears 3 times in any of the three columns, three rows or two main diagonals the game is over and that player wins. If the grid is filled without that happening the game is a draw. For the depicted board, we have Xs in positions C3 and A2, and an O in position B1. It would be O’s turn to make a move; a legal move would be C2, but it is not a good move, because X can force a win by responding A1. O cannot force a win, but…Knight's Tour: The Knight's Tour is a mathematical problem involving a knight on a chessboard. The knight is placed on the empty board and, moving according to the rules of chess, must visit each square exactly once. There are several billion solutions to the problem, of which about 122,000,000 have the knight finishing on the same square on which it begins. When this occurs the tour is said to be closed. Your assignment is to write a program that gives a solution to the Knight's Tour problem recursively. You must hand in a solution in C++ AND Java. The name of the C++ file should be "main.cc" and the name of the Java file should be "Main.java". Write C++ only with a file name of main.cc Please run in IDE and check to ensure that there are no errors occuring Output should look similar to: 1 34 3 18 49 32 13 16 4 19 56 33 14 17 50 31 57 2 35 48 55 52 15 12 20 5 60 53 36 47 30 51 41 58 37 46 61 54 11 26 6 21 42 59 38 27 64 29 43 40 23 8 45 62 25 10 22 7 44 39 24 9 28 63
- Q // Write a program in C++ language that enters a number of integer numbers into a singular matrix whose size is renewed after asking the user about the number of numbers he wants to enter, then he collects these numbers and prints the result on the screenPlease help with this c++ problem Assignment 6 - Monkey Food In the Gaddis textbook read Chapter 8 sections 8.1-8.9 before starting this assignment. This assignment is Programming Challenge 4 from Chapter 8 of the textbook. A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3 x 7 arrray, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey from the keyboard. The number of pounds of food eaten by one monkey in one day should be a floating-point value. Input Validation: Do not accept negative numbers. Then your program should create a report that includes the following information: A nicely-formatted table with a row for each monkey and a column for each day of the week showing the amount of food eaten by that monkey on that day. Be…Programming Language: C Write the following three functions: a) The function gets an array A of length n of ints, and a boolean predicate pred. It returns the smallest index i such that pred(A[i])==true. If no such element is not found, the function returns -1. int find(int* A, int n, bool (*pred)(int)); b) The function gets an array A of length n of ints, and a function f. It applies f to each element of A. void map(int* A, int n, int (*f)(int)); c) The function gets an array A of length n of ints, and a function f. The function f gets 2 ints and works as follows: 1. Start with accumulator = A[0] 2. For i=1...length-1 compute accumulator=f(accumulator, A[i]) 3. Return accumulator For example, if f computes the sum of the two inputs, then reduce() will compute the sum of the entire array. int reduce(int* A, int n, int (*f)(int,int)); Test for the functions: // used for test Q3-find bool is_even(int x) { return x%2 == 0; } bool is_positive(int x) { return x>0; } void…
- Write a program in c++ language that simulates a magic square using 3 one- dimensional parallel arrays of integer type. Each one of the arrays corresponds to a row of the magic square. The program ask the user to enter the values of the magic square row by row and informs the user if the grid a magic square or not. The Lo Shu Magic Square is a grid with 3 rows and 3 columns. It has the following properties: - the grid contains the numbers 1-9 exactly - the sum of each row, each column and each diagonal all add up to the same number. Input for this project - values of the grid(row by row) Output for this project - whether or not the grid is magic square Global constants - const int ROWS = 3; - const int COLS = 3; -const int MIN = 1; -const int MAX = 9; Use following functions: - void fillArray(int arrayRow1[], int arrayRow2[], int arrayRow3[], int size): accepts 3 int arrays and as a size as arguments and fill the arrays out with values entered by the user. - void showArray(int…Write a C++ program that creates a word-search puzzle game where the user should find the hiddenwords in a square array of letters. Your program should first read from the user their choice for thegame: a) easy, b) medium, c) hard, d) exit the game. If the user selects easy, then the 6x6 puzzle,shown in Figure 1, will be generated and displayed to the user. If the user selects medium, then the14 x 14 puzzle shown in Figure 2 should be generated and displayed and lastly, if the user selectsthe hard choice, the program should generate a random puzzle, filling the square array of 20 x 20using random characters/words.Then your program should repeatedly read from the user, a word to be searched for in the puzzle,the row and column number where the word starts from and which orientation to search for. Thewords can be searched vertically (top to bottom), horizontally (left to right), diagonally (upper leftto lower right) and diagonally (upper right to lower left) Words to look for in…Write a C++ program that creates a word-search puzzle game where the user should find the hiddenwords in a square array of letters. Your program should first read from the user their choice for thegame: a) easy, b) medium, c) hard, d) exit the game. If the user selects easy, then the 6x6 puzzle,shown in Figure 1, will be generated and displayed to the user. If the user selects medium, then the14 x 14 puzzle shown in Figure 2 should be generated and displayed and lastly, if the user selectsthe hard choice, the program should generate a random puzzle, filling the square array of 20 x 20using random characters/words. Then your program should repeatedly read from the user, a word to be searched for in the puzzle,the row and column number where the word starts from and which orientation to search for. Thewords can be searched vertically (top to bottom), horizontally (left to right), diagonally (upper leftto lower right) and diagonally (upper right to lower left)
- Write the following three functions in c programming language: a) The function gets an array A of length n of ints, and a boolean predicate pred. It returns the smallest index i such that pred(A[i])==true.If no such element is not found, the function returns -1.int find(int* A, int n, bool (*pred)(int)); b) The function gets an array A of length n of ints, and a function f. It applies f to each element of A.void map(int* A, int n, int (*f)(int)); c) The function gets an array A of length n of ints, and a function f. The function f gets 2 ints and works as follows: Start with accumulator = A[0] For i=1...length-1 compute accumulator=f(accumulator, A[i]) Return accumulator For example, if f computes the sum of the two inputs, then reduce() will compute the sum of the entire array.int reduce(int* A, int n, int (*f)(int,int));Program in C language Part one : Write a program that does the following: Creates int array array_1 of length 10. Creates int array array_2 of length 10. Takes int values from the user of for 10 values for array_1 and array_2, each. Creates a new int array array_3 which copies the values of array_1 and array_2, in interleaved order, into it. Prints out the contents of Prints out the contents of array_1, array_2 and array_3. Part two : Repeat Part one, but this time use arrays of char (instead of int), and stop receiving input into array_1 and array_2 when the user hits Enter / newline and insert a Null character into the array.In java Develop a function that accepts an array and returns true if the array contains any duplicate values or false if none of the values are repeated. Develop a function that returns true if the elements are in decreasing order and false otherwise. A “peak” is a value in an array that is preceded and followed by a strictly lower value. For example, in the array {2, 12, 9, 8, 5, 7, 3, 9} the values 12 and 7 are peaks. Develop a function that returns the number of peaks in an array of integers. Note that the first element does not have a preceding element and the last element is not followed by anything, so neither the first nor last elements can be peaks. Develop a function that finds the starting index of the longest subsequence of values that is strictly increasing. For example, given the array {12, 3, 7, 5, 9, 8, 1, 4, 6}, the function would return 6, since the subsequence {1, 4, 6} is the longest that is strictly increasing. Develop a function that takes a string…