Task 3.a The Code TicTacToeFunctional.cpp The Program Partly Implemented The Game Of TicTacToe,
Task 3.a the code TicTacToeFunctional.cpp The program partly implemented the game of TicTacToe, which allows a user to input the coordinates of each move and display the move on the board. It is runnable but one of the functions, isValidMove(), has not been implemented thus the program can’t check if an input is valid or not. Add your code to complete this function so that the program can check if an input of coordinates is in the right range and the corresponding cell is not occupied. //Functional implementation for basic Tic Tac Toe game (incomplete) #include #include #include using namespace std; void displayBoard(char board[][3]) { cout << " 1 2 3" << endl << endl; for (int row = 0; row < 3; row ) { cout << row 1; for (int col = 0; col < 3; col ) { cout << setw(3) << board[row][col]; if (col != 2) cout << " |"; } cout << endl; if (row != 2) cout << " ____|____|____" << endl << " | | " << endl; } cout << endl; } bool isValidMove(char board[][3], int row, int col) { //Add conditions in the "if statement" to check if row and col are in the range between 0-2 and the cell is blank. //Note that array index starts from 0 if (true /* add your code here */) return true; else return false; } bool getXOMove(char board[][3], int noOfMoves, char playerSymbol) { int row, col; do { cout << "Player " << playerSymbol <> row >> col; cout <= 9) { return true; } else return false; } int main() { char board[3][3]; int noOfMoves; for (int row = 0; row < 3; row ) for (int col = 0; col < 3; col ) board[row][col] = ' '; noOfMoves = 0; bool done = false; char player = 'X'; displayBoard(board); while (!done) { done = getXOMove(board, noOfMoves, player); if (player == 'X') player = 'O'; else player = 'X'; } return 0; } ////////////////////////////////////////////////// Task 3.b Write a program for airplane seat reservation. Assume that there is a small airplane that has 32 seats in 8 rows. Each row has 4 seats. 1 2 3 4 1 _ _ _ _ 2 _ _ _ _ 3 _ _ _ _ 4 _ _ _ _ 5 _ _ _ _ 6 _ _ _ _ 7 _ _ _ _ 8 _ _ _ _ A customer can book a seat by providing the seat’s row and column numbers. For instance, if a customer books the seat (2,4), then the seat in row 2 and column 4 is occupied: 1 2 3 4 1 _ _ _ _ 2 _ _ _ X 3 _ _ _ _ 4 _ _ _ _ 5 _ _ _ _ 6 _ _ _ _ 7 _ _ _ _ 8 _ _ _ _ I f another customer books the seat (7,3), then the seat availability becomes: 1 2 3 4 1 _ _ _ _ 2 _ _ _ X 3 _ _ _ _ 4 _ _ _ _ 5 _ _ _ _ 6 _ _ _ _ 7 _ _ X _ 8 _ _ _ _ Write a program that can display availability of airplane seats (in the format shown above), take customer’s booking of seats and update seat availability after taking customer’s booking. If a customer requests in a seat that is already reserved, your program should say that that seat is occupied and ask for another choice. Your program should keep running until no further booking or all seats are reserved.
The Difference Between MAPE And MASE Is That MASE Gives A Heavier Penalty To
The difference between MAPE and MASE is that MASE gives a heavier penalty to positive errors (over forecasts) than negative forecasts (under forecasts), while MAPE weighs both types of errors equally. true or false Naïve Forecasts are example of extrapolation method. true or false The principle of improving forecast precision via ensembles is the same principle underlying the advantage portfolios and diversification in financial investment. true or false With moving average forecasting or visualization, the only choice that the user must make is the width of the window (w) . true or false
Here Is The Question And My Code Of Excel VBA. The Line In My
Here is the question and my code of Excel VBA. The line in my code is always highlighted and says ‘overflow’ I am wondering how I can fix it.
Rewrite The Program Shown Below So That It Is No Longer Vulnerable To A
Rewrite the program shown below so that it is no longer vulnerable to a buffer overflow. Please add explanation. Thank you. int main(int argc, char *argv[]){ int valid = FALSE; char str1[8]; char str2[8]; next_tag(str1); gets(str2); if (strncmp(str1, str2, 8) == 0) valid = TRUE; printf(“buffer1: str1(%s), str2(%s), valid(%d)n”, str1, str2, valid); }
(The Account Class) Design A Class In Java Named Account That Contains: A Private
(The Account class) Design a class in Java named Account that contains: A private int data field named id for the account (default 0). A private double data field named balance for the account (default 0). A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume all accounts have the same interest rate. A private Date data field named dateCreated that stores the date when the account was created. A no-arg constructor that creates a default account. A constructor that creates an account with the specified id and initial balance. The accessor and mutator methods for id, balance, and annualInterestRate. The accessor method for dateCreated. A method named getMonthlyInterestRate() that returns the monthly interest rate. A method named withdraw that withdraws a specified amount from the account. A method named deposit that deposits a specified amount to the account. Draw the UML diagram for the class. Implement the class. Write a test program that creates an Account object with an account ID of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the depositmethod to deposit $3,000, and print the balance, the monthly interest, and the date when this account was created. public class Test { public static void main (String[] args) { Account account = new Account(1122, 20000); Account.setAnnualInterestRate(4.5); account.withdraw(2500); account.deposit(3000); System.out.println(“Balance is ” account.getBalance()); System.out.println(“Monthly interest is ” account.getMonthlyInterest()); System.out.println(“This account was created at ” account.getDateCreated()); } } Class Account { // Implement the class here }
Consider A Grid Where Each Cell Has A Different Cost To Travel Across The
Consider a grid where each cell has a different cost to travel across the regions. Assume we can only travel and stop in straight lines between the corners of these cells. Note that the cost to travel along a border between two cells is the cheapest of the two. We want to find the cheapest route from the lower-left corner to the upper-right corner of the grid under these constraints. For example in the following 3 × 3 grid, one of the cheapest routes of cost 2 3 4 2=11 is highlighted. We will read in a sequence of problem instances. The first line will contain two positive integers n and m, both at most 400, denoting the dimensions of the grid; here the number of rows is n and the number of columns is m. We then are given n lines of m non-negative integers representing the costs for the cells. All integers will be separated by spaces. The last problem instance will have values of n = m = 0, which is not processed. The input should be taken from keyboard/stdin/System.in. Sample Input: 3 3 0 6 2 1 8 4 2 3 7 3 5 1 3 9 9 1 5 10 1 8 4 2 7 8 2 6 0 0 The output for each instance should be a single integer (one per line) denoting the minimum cost to travel. Print these to the console/stdout/System.out. Sample Output: 11 17 You need to submit a single Python source program (Python 3). There will be three inputs of several test cases of increasing difficulty.
Write A C Program That Takes Two Numbers From The Command Line And Perform
Write a C program that takes two numbers from the command line and perform and arithmetic operations with them. Additionally your program must be able to take three command line arguments where if the last argument is ‘a’ an addition is performed, and if ‘s’ then subtraction is performed with the first two arguments. Do not use ‘cin’ or gets() type functions. Do not for user input. All input must be specified on the command line separated by blank spaces (i.e. use the argv and argc input parameters). Example1: Exercise1_1234567.exe 10 2 a which should return 10 2 = 12, i.e. the last (and only) line on the console will be: 12
Use The Weka Vote.arff To Answer The Questions Below: Select A Dataset That Is
Use the Weka vote.arff to answer the questions below: Select a dataset that is appropriate for association rule mining, and perform the following tasks o Prepare and preprocess the data if needed. o Use the Weka tools to find the rules and appropriate parameter settings. o Determine the ten most important rules, and explain how they could be useful. o Write a short report that explains your work and address the following issues: o Description of the data, and statement of the mining problem. o Approach used for the mining. o Description of the experiments, and discussion of the results. o Conclusion that summarizes the findings and limitations/challenges faced during this work.
Using The Input Argument Phrase ‘Huge Dog 123.56’, Develop A C Script So That
Using the input argument phrase ‘Huge Dog 123.56’, develop a C script so that it counts the number of characters entered in the first argument and displays the number to the console. Argument one (‘Huge) should result in the number 4 being displayed to the console screen. It should be displayed on a separate line with no other characters or text. Using the command line arguments phrase ‘Huge Dog 123.56’, your console should display: 4, 3 and 6 on separate lines.
Write A Program That Prompts The User To Input A String And Outputs
Write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use dynamic arrays to store the string.) my code below: /* Your code from Chapter 8, exercise 5 is below. Rewrite the following code to using dynamic arrays. */ #include #include #include using namespace std; int main() { //char str[81]; //creating memory for str array of size 80 using dynamic memory allocation char *str = new char[80]; int len; int i; cout << "Enter a string: "; cin.get(str, 80); cout << endl; cout << "String in upper case letters is:"<< endl; len = strlen(str); //displaying each character in upper case letter for (i = 0; i < len; i ) cout << static_cast(toupper(*(str i))); cout << endl; return 0; } keeping getting it wrong need help not sure what im doing wrong Input 11 Hello World Output Enter a string: 11 String in upper case letters is: 11 Hello World Test Case Incomplete To Upper Test 2 Input 14 I love to code Output Enter a string: 14 String in upper case letters is: 14 I love to code
In This Checkpoint We Will Be Using CSS To Provide Basic Visual Changes To
Get college assignment help at Smashing Essays please help me to solve this HTML question, thanks a lot !
Battleship You Should Write A Simplified Version Of Game Battleship. While The Game Is
This has to be done is PYTHON. Please write original code and include comments. Thanks!
We’re Given The Following Code To Start: Please No Copy And Paste From Other
We’re given the following code to start: Please no copy and paste from other posters thank you!!
Task This Is A Practical Assessment And Will Enhance And Test Your Practical Skills
Task This is a practical assessment and will enhance and test your practical skills related to the subject topic. Students are required to set up a network consisting of PCs, routers, switches and servers. You will need to configure routing between routers, use any dynamic routing protocol. The PCs (clients) will be connected to switches and switches to the router’s interfaces. Clients and Servers are connected on different networks (don’t attach clients and servers on same network). Client(s) Switch Router Router Switch Server(s) To complete this assessment you are expected to refer to information beyond the text book. This assignment is open; in that you are free to choose the devices or software you use to complete the specified tasks. Students are expected to accomplish this task by utilising the necessary commands discussed in lectures and also described in the prescribed text book. There are numerous web sites available that discuss networking , however you MUST list your sources of information for the different tasks. When completing this project, you may encounter errors or experience difficulties getting your setup to work. If this occurs, your challenge is to analyse why they happen and report on how you solved the problems you encountered. Task 1 – Setting up a Network [10 marks] Perform the following activities and support your workings with screenshots [10 marks]: Configure the PCs, Server and Router interfaces with appropriate network addressing; Configure any classless dynamic routing protocol on the routers; On any client, ping the client’s own network interfaces, then the local router gateway interface, then the remote router interface, then the servers. Check full network conductivity; Use the traceroute command from the client to the server. Include results of the traceroute in your submission, explaining meaning of traceroute output. Task 2 – Configuring Network Services [10 marks]: Using the same network topology that you have setup in Task 1, perform the following additional activities DHCP: Configure DHCP servers and show that the client PC has successfully received IP Addresses and other network parameters (default gateway, subnet mask and DNS IP address) using DHCP WEB Server: Configure WEBs server on the dedicated machines in their specified networks, with URL as yourname.csu.org DNS: Configure DNS Servers on the server device and demonstrate that forward and reverse DNS are working from the client PC; test DNS Server by browsing yourname.csu.org from client PC, DNS must resolve this URL to IP address of WEB Server Firewall: Configure traffic filtering on the web servers to block ONLY HTTP TCP traffic between one of the client PCs and WEB Servers and allowing all other IP traffic, provide evidence of such traffic filtering. You should verify firewall by using PING and HTTPS TCP traffic which should not be blocked. A series of screenshots with commentary on each of the required tasks is to be submitted. The submission must include a comprehensive explanation of each task in your own words and all the commands used along with the output (or final result) in report format.
What Kinds Of Threat Related To Data Theft Does An Organisation Face?
What kinds of threat related to data theft does an organisation face?
( Int Fact ( Int N) ; 3 Double Compute E () ; 4
( int fact ( int n) ; 3 double compute e () ; 4 int main(){ 5 printf (”%l fn” , compute e () ) ; 6 return 0; 7 } 8 9 int fact ( int n){ 10 int i , product = 1; 11 for ( i = 1 ; i<= n ; i ) product ∗= i ; 12 return product ; 13 } 14 15 double compute e () 16 { 17 int i ; 18 double sum = 0.0; 19 for ( i = 0 ; i <= 8 ; i ) sum = 1 / fact ( i ) ; 20 return sum; 21 } ) Please create a C program with the following code is supposed to perform a certain calculation, but generates a wrong result. What do you thing the code is trying to calculate? Explain what is wrong and why? Your task is to modify the code to correct it!
Please Create A C Program With The Following C Code Declares Variable Mtx Of
Please create a C program with the following C code declares variable mtx of matrix type, and dynamically allocates memory for mtx. It will then get keyboard input for the N-by-N matrix. Subsequently, the program de-allocates (free) the memory of the matrix. A. Your task is to write the codes to dynamically allocate and de-allocate the memory for the matrix. B. Subsequently, you have to modify the above code so that now the program will first ask the user to enter the size of the matrix, accept two matrices of the same size (maximum size 5-by-5) where each element of these matrices are manually input, and then perform matrix addition. The program will then output all the input matrices and the matrix addition results, both to the standard output screen and also to the text file called matrix.txt.
Please Create C Program, The Task Is To Implement A Function Edoublepowerx That Has
Please create C program, the task is to implement a function edoublepowerx that has an input parameter x of floating-point value (real numbers), and then return the approximation of e^2x as computed using the formula e^2x = 1 2x / 1! 4x^2 / 2! 8x^3 / 3! … 1024x^10 / 10! . Use this function in a C main program that asks users for the x value, perform the calculation, and output the result. To assist the implementation, you may use the recursive function fact(n) and power(x,n).
Task 1 A. Design A Program For A Movie Rating Guide, Which Can
Task 1 a. Design a program for a movie rating guide, which can be installed in a kiosk in theaters. Each theater patron enters a value from 0 to 4 indicating the number of stars that the patron awards to the guide’s featured movie of the week. If a user enters a star value that does not fall in the correct range, re-prompt the user continuously until a correct value is entered. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, display the average star rating for the movie. b. Modify the movie-rating program so that a user gets three tries to enter a valid rating. After three incorrect entries, the program issues an appropriate message and continues with a new user. To be awarded full marks you must submit: Pseudo code design Flow chart design Desk check Thank you for that
Task 2 A Nursery Wants To Keep Track Of All Its Products, Including
Task 2 A nursery wants to keep track of all its products, including plants, fountains, garden hardware (wheelbarrow, shovels etc) and also soil and sand which they sell. They buy all stock from the wholesalers. The management wants to know which staff members have been selling what, and from which wholesaler the products were purchased. There are also times when a customer returns a product for a refund, and such information should be available in the system. The nursery also delivers some items to customers, and they would like to integrate the booking process with the purchasing process. The nursery requires to lodge a business activity for each quarter to the Tax authority (ATO). If there is any inconsistencies or disputes ATO seek clarification from the nursery. Based on the above scenario a. Identify all the requirements and categorize Thank you for that
Describe How The Sensors(Ultrasonic, Rotation, Infrared) And The Data Logged By The Robot Can
Describe how the sensors(Ultrasonic, Rotation, Infrared) and the data logged by the robot can be used to locate the casualty.
The post Task 3.a The Code TicTacToeFunctional.cpp The Program Partly Implemented The Game Of TicTacToe, appeared first on Smashing Essays.