The document provides suggestions to fix errors in code for a Tic Tac Toe game:
1) On line 23, replace the check for cells 0 and 1 with a check that both cells equal 'x'.
2) On line 29, close the loop bracket before the line starting with bool tie().
3) Line 37 error will be resolved by the above changes as main's scope is not predefined.
4) On line 69, remove the excess bracket. Additional input handling is needed as player choices are not defined. Sample code is provided to get input and play the game.
#In this project you will write a program play TicTacToe #using tw.pdfaquacareser
#In this project you will write a program play TicTacToe
#using two players (labels 0,1) or one play (label 0) playing with the machine (label 1).
#The TicTacToe board has 9 integers board = [1,2,3,4,5,6,7,8,9]. The following
# are the modules for the program
#
#def reset() resets the board to the original values
# board = [1,2,3,4,5,6,7,8,9]
#
#def printBoard() print the current state of the board using the format
#
#The current TicTacToe Board
# | 1 | 2 | 3 |
# | 4 | 5 | 6 |
# | 7 | O | 9 |
#
#The current TicTacToe Board
# | X | 2 | 3 |
# | 4 | 5 | 6 |
# | 7 | O | 9 |
#Note from the above that player 0 and 1 have played numbers 8 and 1
#respectively and the board display O for player 0 and X from player 1
#
#def changeBoard(num1, player) using the chosen box number to change
#the value of the box to 0 or -1 depending on whether the player is 0 or 1,
#respectively.
#
#def play(player) prints the player number (0 or 1) and prompts the player
# to enter a box value that have not changed to \'O\' or \'X\'
#
#def checkRows(value) checks to see which of the rows of the board
# has the same value and returns True, otherwise, returns False
#
#def checkCols(value) checks to see which of the cols of the board
# has the same value and returns True, otherwise, returns False
#
#def checkDiagonal(value) checks to see which of the diagonals of the board
# has the same value and returns True, otherwise, returns False
#
#def win(player) checks if a player wins the game, returns True of the player wins
# and False otherwise
#
#def machinePlay(player) plays the role of the player using random number.
# this function generates numbers in the interval [1,9] and uses the first
# generated random number that has not been used to play the game. The
#
#def ticTacToe(numPlayers) accepts the number of players and simulates the
#ticTapToe, asking players to enter unused box numbers.
#
#def main() is the driver module that accepts the number of players from the user
# and calls the ticTacToe module
#Assignment: Complete the follwoing modules:
#checkCols
#checkRows
#checkDiagonal
#win
#Sample of the output is
#
#Project
#This game can be played by one or two players
#Enter the number of players, 1/2 for one/two players: 1
#
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | 8 | 9 |
#Player 0 Enter a box value: 9
#
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | 8 | O |
#Player 1 ***Computer*** playing
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 0 Enter a box value: 1
#
#The current TicTapToe Board
#| O | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 1 ***Computer*** playing
#
#The current TicTapToe Board
#| O | X | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 0 Enter a box value: 5
#
#The current TicTapToe Board
#| O | X | 3 |
#| 4 | O | 6 |
#| 7 | X | O |
#Player 0 Wins
#Do you want to quit?
#Begin Program
#import random number generator
#from random library
#from random import randint, seed
#Global va.
#In this project you will write a program play TicTacToe #using tw.pdfaquapariwar
#In this project you will write a program play TicTacToe
#using two players (labels 0,1) or one play (label 0) playing with the machine (label 1).
#The TicTacToe board has 9 integers board = [1,2,3,4,5,6,7,8,9]. The following
# are the modules for the program
#
#def reset() resets the board to the original values
# board = [1,2,3,4,5,6,7,8,9]
#
#def printBoard() print the current state of the board using the format
#
#The current TicTacToe Board
# | 1 | 2 | 3 |
# | 4 | 5 | 6 |
# | 7 | O | 9 |
#
#The current TicTacToe Board
# | X | 2 | 3 |
# | 4 | 5 | 6 |
# | 7 | O | 9 |
#Note from the above that player 0 and 1 have played numbers 8 and 1
#respectively and the board display O for player 0 and X from player 1
#
#def changeBoard(num1, player) using the chosen box number to change
#the value of the box to 0 or -1 depending on whether the player is 0 or 1,
#respectively.
#
#def play(player) prints the player number (0 or 1) and prompts the player
# to enter a box value that have not changed to \'O\' or \'X\'
#
#def checkRows(value) checks to see which of the rows of the board
# has the same value and returns True, otherwise, returns False
#
#def checkCols(value) checks to see which of the cols of the board
# has the same value and returns True, otherwise, returns False
#
#def checkDiagonal(value) checks to see which of the diagonals of the board
# has the same value and returns True, otherwise, returns False
#
#def win(player) checks if a player wins the game, returns True of the player wins
# and False otherwise
#
#def machinePlay(player) plays the role of the player using random number.
# this function generates numbers in the interval [1,9] and uses the first
# generated random number that has not been used to play the game. The
#
#def ticTacToe(numPlayers) accepts the number of players and simulates the
#ticTapToe, asking players to enter unused box numbers.
#
#def main() is the driver module that accepts the number of players from the user
# and calls the ticTacToe module
#Assignment: Complete the follwoing modules:
#checkCols
#checkRows
#checkDiagonal
#win
#Sample of the output is
#
#Project
#This game can be played by one or two players
#Enter the number of players, 1/2 for one/two players: 1
#
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | 8 | 9 |
#Player 0 Enter a box value: 9
#
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | 8 | O |
#Player 1 ***Computer*** playing
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 0 Enter a box value: 1
#
#The current TicTapToe Board
#| O | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 1 ***Computer*** playing
#
#The current TicTapToe Board
#| O | X | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 0 Enter a box value: 5
#
#The current TicTapToe Board
#| O | X | 3 |
#| 4 | O | 6 |
#| 7 | X | O |
#Player 0 Wins
#Do you want to quit?
#Begin Program
#import random number generator
#from random library
#from random import randint, seed
#Global va.
Game programming language is the software development for the video games. Programming for games needs the substantial skill in the software engineering and required specialization in the computer graphic, stage design, and simulation.
This is an individual project, to be completed on your own. It i.docxabhi353063
This is an
individual
project, to be completed on your own. It is considered dishonest either to read someone else's solution or to provide a classmate with a copy of your work. Do not make the mistake of thinking that superficial changes in a program (such as altering comments, changing variable names, or interchanging statements) can be used to avoid detection. If you cannot do the work yourself, it is extremely unlikely that you can succeed in disguising someone else's work. We are adamant that cheating in any form is not tolerated. Even the most trivial assignment is better not done than if you cheat to complete it.
Prerequisites
Primitive types
Conditionals
Loops
Arrays
Learning Objectives
Problem Solving
Traversing and manipulating 2-dimensional arrays
Using nested loops
Introduction
In this project, you will implement the logic of the game
Othello
, also known as
Reversi
.
Game Rules
Othello is a strategy board game for two players on a squared checkered board. It is played with identical disks that are white on one side and black on the other. Players take turns placing disks on the board with their assigned color facing up.
The game starts with four disks placed in a square at the center of the board in a standard diagonal pattern: two facing white side up, two facing black side up and same-colored disk on a diagonal with each other. These four initial disks are
not
placed by the player.
The black player moves first. He must place a disk with the black side up on the board, in such a position that there exists
at least
one straight occupied line between the new disk and another dark disk, with one or more contiguous white disks
bounded
between them. During a move, all bounded disks of the opponent's color are turned over to the current's player color. A straight line involves: horizontal, vertical and diagonal lines in every possible direction.
It is possible to bound disks in more than one direction during a single move.
Players take turns to play. When a player doesn't have any valid moves, his turned is skipped. The game must keep going while there are valid moves by either player. The goal of the game is to have the
majority of the disks displaying your color
when there are no more possible moves.
We suggest that you play
an online version of the game
to grasp the idea.
Your Task
In this project, you will implement the rules and logic for Othello. You are provided with the skeleton code containing the
basic methods
that you need to complete to launch this game on the java console.
You have the freedom to use additional methods and variables to structure your solution, as long as the basic methods behave as expected.
Implementation Details
This project consists of just one class:
Othello
: it implements the logic of the game. You will implement the missing methods.
You should begin coding
after you have read the entire handout, understood the problem and made a plan for solving it.
Variables
The
Othello
clas ...
NO PAPER ANSWERS. ALL ANSWER SUBMISSIONS SHOULD BE ABLE TO RUN WIT.pdffms12345
need solution plus constants Solve the following initial value problem y\" - 3y^2 = 0, with y(0)
= 2, y\'(0) = 4. (y is a function of t).
Solution
Let p = y\' =dy/dt. Then, by the chain rule, y\'\' = d²y/dt² = dp/dt = dp/dy dy/dt = p dp/dy = 3y²,
Now, we have a 1st order differential equation with separable variables. It follows that
p dp = 3y² dy. Integrating, we get
p²/2 = y³ + C Since at t =0 y(0) = 2 and y\'(0) = 4, then
4²/2 = 2³ + C
C = 0
p² = 2y³
p = dy/dt = 2 y^(3/2)
y^(-3/2) dy = 2 dt
Integrating,
-2 y^(-1/2) = 2 t + K
-2/(radic;y) = 2 t + K
y = 4/(2 t + K)²
Since y = 2 for t = 0,
2= 4/K²
K = 2, so that this is defined in the reals for t 0
y = 2/(t + 1)².
In Java using Eclipse, Im suppose to write a class that encapsulat.pdfanjandavid
In Java using Eclipse, I\'m suppose to write a class that encapsulates a tic tac toe board using two
dimensional arrays. It should only involve the human player vs. the computer, and should
randomly select who should use \'X\' or \'O\' and whether the human player or the computer
should go first. Verify that all moves by the human player are to a valid space on the tic-tac-toe
board, and an incorrect choice should not halt or terminate the game. Below is my Java program
that is currently a work in progress. Can you help me remodify it? Thanks.
import java.util.Scanner;
public class LeavinesTicTacToe
{
public static Scanner sc = new Scanner(System.in);
public static void main(String[] args)
{
final int SIZE = 3;
char[][] board = new char[SIZE][SIZE]; // game board
resetBoard(board); // initialize the board (with \' \' for all cells)
// First, welcome message and display the board.
System.out.println(\"===== WELCOME TO THE TIC-TAC-TOE GAME!! =====\ \");
showBoard(board);
// Then ask the user which symbol (x or o) he/she wants to play.
System.out.print(\" Which symbol do you want to play, \\\"x\\\" or \\\"o\\\"? \");
char userSymbol = sc.next().toLowerCase().charAt(0);
char compSymbol = (userSymbol == \'x\') ? \'o\' : \'x\';
// Also ask whether or not the user wants to go first.
System.out.println();
System.out.print(\" Do you want to go first (y/n)? \");
char ans = sc.next().toLowerCase().charAt(0);
int turn; // 0 -- the user, 1 -- the computer
int remainCount = SIZE * SIZE; // empty cell count
// THE VERY FIRST MOVE.
if (ans == \'y\') {
turn = 0;
userPlay(board, userSymbol); // user puts his/her first tic
}
else {
turn = 1;
compPlay(board, compSymbol); // computer puts its first tic
}
// Show the board, and decrement the count of remaining cells.
showBoard(board);
remainCount--;
// Play the game until either one wins.
boolean done = false;
int winner = -1; // 0 -- the user, 1 -- the computer, -1 -- draw
while (!done && remainCount > 0) {
// If there is a winner at this time, set the winner and the done flag to true.
done = isGameWon(board, turn, userSymbol, compSymbol); // Did the turn won?
if (done)
winner = turn; // the one who made the last move won the game
else {
// No winner yet. Find the next turn and play.
turn = (turn + 1 ) % 2;
if (turn == 0)
userPlay(board, userSymbol);
else
compPlay(board, compSymbol);
// Show the board after one tic, and decrement the rem count.
showBoard(board);
remainCount--;
}
}
// Winner is found. Declare the winner.
if (winner == 0)
System.out.println(\"\ ** YOU WON. CONGRATULATIONS!! **\");
else if (winner == 1)
System.out.println(\"\ ** YOU LOST.. Maybe next time :) **\");
else
System.out.println(\"\ ** DRAW... **\");
}
public static void resetBoard(char[][] brd)
{
for (int i = 0; i < brd.length; i++)
for (int j = 0; j < brd[0].length; j++)
brd[i][j] = \' \';
}
public static void showBoard(char[][] brd)
{
int numRow = brd.length;
int numCol = brd[0].length;
System.out.println();
// First write the column he.
#In this project you will write a program play TicTacToe #using tw.pdfaquacareser
#In this project you will write a program play TicTacToe
#using two players (labels 0,1) or one play (label 0) playing with the machine (label 1).
#The TicTacToe board has 9 integers board = [1,2,3,4,5,6,7,8,9]. The following
# are the modules for the program
#
#def reset() resets the board to the original values
# board = [1,2,3,4,5,6,7,8,9]
#
#def printBoard() print the current state of the board using the format
#
#The current TicTacToe Board
# | 1 | 2 | 3 |
# | 4 | 5 | 6 |
# | 7 | O | 9 |
#
#The current TicTacToe Board
# | X | 2 | 3 |
# | 4 | 5 | 6 |
# | 7 | O | 9 |
#Note from the above that player 0 and 1 have played numbers 8 and 1
#respectively and the board display O for player 0 and X from player 1
#
#def changeBoard(num1, player) using the chosen box number to change
#the value of the box to 0 or -1 depending on whether the player is 0 or 1,
#respectively.
#
#def play(player) prints the player number (0 or 1) and prompts the player
# to enter a box value that have not changed to \'O\' or \'X\'
#
#def checkRows(value) checks to see which of the rows of the board
# has the same value and returns True, otherwise, returns False
#
#def checkCols(value) checks to see which of the cols of the board
# has the same value and returns True, otherwise, returns False
#
#def checkDiagonal(value) checks to see which of the diagonals of the board
# has the same value and returns True, otherwise, returns False
#
#def win(player) checks if a player wins the game, returns True of the player wins
# and False otherwise
#
#def machinePlay(player) plays the role of the player using random number.
# this function generates numbers in the interval [1,9] and uses the first
# generated random number that has not been used to play the game. The
#
#def ticTacToe(numPlayers) accepts the number of players and simulates the
#ticTapToe, asking players to enter unused box numbers.
#
#def main() is the driver module that accepts the number of players from the user
# and calls the ticTacToe module
#Assignment: Complete the follwoing modules:
#checkCols
#checkRows
#checkDiagonal
#win
#Sample of the output is
#
#Project
#This game can be played by one or two players
#Enter the number of players, 1/2 for one/two players: 1
#
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | 8 | 9 |
#Player 0 Enter a box value: 9
#
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | 8 | O |
#Player 1 ***Computer*** playing
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 0 Enter a box value: 1
#
#The current TicTapToe Board
#| O | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 1 ***Computer*** playing
#
#The current TicTapToe Board
#| O | X | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 0 Enter a box value: 5
#
#The current TicTapToe Board
#| O | X | 3 |
#| 4 | O | 6 |
#| 7 | X | O |
#Player 0 Wins
#Do you want to quit?
#Begin Program
#import random number generator
#from random library
#from random import randint, seed
#Global va.
#In this project you will write a program play TicTacToe #using tw.pdfaquapariwar
#In this project you will write a program play TicTacToe
#using two players (labels 0,1) or one play (label 0) playing with the machine (label 1).
#The TicTacToe board has 9 integers board = [1,2,3,4,5,6,7,8,9]. The following
# are the modules for the program
#
#def reset() resets the board to the original values
# board = [1,2,3,4,5,6,7,8,9]
#
#def printBoard() print the current state of the board using the format
#
#The current TicTacToe Board
# | 1 | 2 | 3 |
# | 4 | 5 | 6 |
# | 7 | O | 9 |
#
#The current TicTacToe Board
# | X | 2 | 3 |
# | 4 | 5 | 6 |
# | 7 | O | 9 |
#Note from the above that player 0 and 1 have played numbers 8 and 1
#respectively and the board display O for player 0 and X from player 1
#
#def changeBoard(num1, player) using the chosen box number to change
#the value of the box to 0 or -1 depending on whether the player is 0 or 1,
#respectively.
#
#def play(player) prints the player number (0 or 1) and prompts the player
# to enter a box value that have not changed to \'O\' or \'X\'
#
#def checkRows(value) checks to see which of the rows of the board
# has the same value and returns True, otherwise, returns False
#
#def checkCols(value) checks to see which of the cols of the board
# has the same value and returns True, otherwise, returns False
#
#def checkDiagonal(value) checks to see which of the diagonals of the board
# has the same value and returns True, otherwise, returns False
#
#def win(player) checks if a player wins the game, returns True of the player wins
# and False otherwise
#
#def machinePlay(player) plays the role of the player using random number.
# this function generates numbers in the interval [1,9] and uses the first
# generated random number that has not been used to play the game. The
#
#def ticTacToe(numPlayers) accepts the number of players and simulates the
#ticTapToe, asking players to enter unused box numbers.
#
#def main() is the driver module that accepts the number of players from the user
# and calls the ticTacToe module
#Assignment: Complete the follwoing modules:
#checkCols
#checkRows
#checkDiagonal
#win
#Sample of the output is
#
#Project
#This game can be played by one or two players
#Enter the number of players, 1/2 for one/two players: 1
#
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | 8 | 9 |
#Player 0 Enter a box value: 9
#
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | 8 | O |
#Player 1 ***Computer*** playing
#The current TicTapToe Board
#| 1 | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 0 Enter a box value: 1
#
#The current TicTapToe Board
#| O | 2 | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 1 ***Computer*** playing
#
#The current TicTapToe Board
#| O | X | 3 |
#| 4 | 5 | 6 |
#| 7 | X | O |
#Player 0 Enter a box value: 5
#
#The current TicTapToe Board
#| O | X | 3 |
#| 4 | O | 6 |
#| 7 | X | O |
#Player 0 Wins
#Do you want to quit?
#Begin Program
#import random number generator
#from random library
#from random import randint, seed
#Global va.
Game programming language is the software development for the video games. Programming for games needs the substantial skill in the software engineering and required specialization in the computer graphic, stage design, and simulation.
This is an individual project, to be completed on your own. It i.docxabhi353063
This is an
individual
project, to be completed on your own. It is considered dishonest either to read someone else's solution or to provide a classmate with a copy of your work. Do not make the mistake of thinking that superficial changes in a program (such as altering comments, changing variable names, or interchanging statements) can be used to avoid detection. If you cannot do the work yourself, it is extremely unlikely that you can succeed in disguising someone else's work. We are adamant that cheating in any form is not tolerated. Even the most trivial assignment is better not done than if you cheat to complete it.
Prerequisites
Primitive types
Conditionals
Loops
Arrays
Learning Objectives
Problem Solving
Traversing and manipulating 2-dimensional arrays
Using nested loops
Introduction
In this project, you will implement the logic of the game
Othello
, also known as
Reversi
.
Game Rules
Othello is a strategy board game for two players on a squared checkered board. It is played with identical disks that are white on one side and black on the other. Players take turns placing disks on the board with their assigned color facing up.
The game starts with four disks placed in a square at the center of the board in a standard diagonal pattern: two facing white side up, two facing black side up and same-colored disk on a diagonal with each other. These four initial disks are
not
placed by the player.
The black player moves first. He must place a disk with the black side up on the board, in such a position that there exists
at least
one straight occupied line between the new disk and another dark disk, with one or more contiguous white disks
bounded
between them. During a move, all bounded disks of the opponent's color are turned over to the current's player color. A straight line involves: horizontal, vertical and diagonal lines in every possible direction.
It is possible to bound disks in more than one direction during a single move.
Players take turns to play. When a player doesn't have any valid moves, his turned is skipped. The game must keep going while there are valid moves by either player. The goal of the game is to have the
majority of the disks displaying your color
when there are no more possible moves.
We suggest that you play
an online version of the game
to grasp the idea.
Your Task
In this project, you will implement the rules and logic for Othello. You are provided with the skeleton code containing the
basic methods
that you need to complete to launch this game on the java console.
You have the freedom to use additional methods and variables to structure your solution, as long as the basic methods behave as expected.
Implementation Details
This project consists of just one class:
Othello
: it implements the logic of the game. You will implement the missing methods.
You should begin coding
after you have read the entire handout, understood the problem and made a plan for solving it.
Variables
The
Othello
clas ...
NO PAPER ANSWERS. ALL ANSWER SUBMISSIONS SHOULD BE ABLE TO RUN WIT.pdffms12345
need solution plus constants Solve the following initial value problem y\" - 3y^2 = 0, with y(0)
= 2, y\'(0) = 4. (y is a function of t).
Solution
Let p = y\' =dy/dt. Then, by the chain rule, y\'\' = d²y/dt² = dp/dt = dp/dy dy/dt = p dp/dy = 3y²,
Now, we have a 1st order differential equation with separable variables. It follows that
p dp = 3y² dy. Integrating, we get
p²/2 = y³ + C Since at t =0 y(0) = 2 and y\'(0) = 4, then
4²/2 = 2³ + C
C = 0
p² = 2y³
p = dy/dt = 2 y^(3/2)
y^(-3/2) dy = 2 dt
Integrating,
-2 y^(-1/2) = 2 t + K
-2/(radic;y) = 2 t + K
y = 4/(2 t + K)²
Since y = 2 for t = 0,
2= 4/K²
K = 2, so that this is defined in the reals for t 0
y = 2/(t + 1)².
In Java using Eclipse, Im suppose to write a class that encapsulat.pdfanjandavid
In Java using Eclipse, I\'m suppose to write a class that encapsulates a tic tac toe board using two
dimensional arrays. It should only involve the human player vs. the computer, and should
randomly select who should use \'X\' or \'O\' and whether the human player or the computer
should go first. Verify that all moves by the human player are to a valid space on the tic-tac-toe
board, and an incorrect choice should not halt or terminate the game. Below is my Java program
that is currently a work in progress. Can you help me remodify it? Thanks.
import java.util.Scanner;
public class LeavinesTicTacToe
{
public static Scanner sc = new Scanner(System.in);
public static void main(String[] args)
{
final int SIZE = 3;
char[][] board = new char[SIZE][SIZE]; // game board
resetBoard(board); // initialize the board (with \' \' for all cells)
// First, welcome message and display the board.
System.out.println(\"===== WELCOME TO THE TIC-TAC-TOE GAME!! =====\ \");
showBoard(board);
// Then ask the user which symbol (x or o) he/she wants to play.
System.out.print(\" Which symbol do you want to play, \\\"x\\\" or \\\"o\\\"? \");
char userSymbol = sc.next().toLowerCase().charAt(0);
char compSymbol = (userSymbol == \'x\') ? \'o\' : \'x\';
// Also ask whether or not the user wants to go first.
System.out.println();
System.out.print(\" Do you want to go first (y/n)? \");
char ans = sc.next().toLowerCase().charAt(0);
int turn; // 0 -- the user, 1 -- the computer
int remainCount = SIZE * SIZE; // empty cell count
// THE VERY FIRST MOVE.
if (ans == \'y\') {
turn = 0;
userPlay(board, userSymbol); // user puts his/her first tic
}
else {
turn = 1;
compPlay(board, compSymbol); // computer puts its first tic
}
// Show the board, and decrement the count of remaining cells.
showBoard(board);
remainCount--;
// Play the game until either one wins.
boolean done = false;
int winner = -1; // 0 -- the user, 1 -- the computer, -1 -- draw
while (!done && remainCount > 0) {
// If there is a winner at this time, set the winner and the done flag to true.
done = isGameWon(board, turn, userSymbol, compSymbol); // Did the turn won?
if (done)
winner = turn; // the one who made the last move won the game
else {
// No winner yet. Find the next turn and play.
turn = (turn + 1 ) % 2;
if (turn == 0)
userPlay(board, userSymbol);
else
compPlay(board, compSymbol);
// Show the board after one tic, and decrement the rem count.
showBoard(board);
remainCount--;
}
}
// Winner is found. Declare the winner.
if (winner == 0)
System.out.println(\"\ ** YOU WON. CONGRATULATIONS!! **\");
else if (winner == 1)
System.out.println(\"\ ** YOU LOST.. Maybe next time :) **\");
else
System.out.println(\"\ ** DRAW... **\");
}
public static void resetBoard(char[][] brd)
{
for (int i = 0; i < brd.length; i++)
for (int j = 0; j < brd[0].length; j++)
brd[i][j] = \' \';
}
public static void showBoard(char[][] brd)
{
int numRow = brd.length;
int numCol = brd[0].length;
System.out.println();
// First write the column he.
The following is my code for a connectn program. When I run my code .pdfeyelineoptics
The following is my code for a connectn program. When I run my code in the tester, I failed two
out 10 tests. I was hoping for some help in finding what causes these errors. I have included the
homework prompt and test failed results. Thank you so much!
#include
#include
#include
void read_args(int argc, char *argv[], int* num_rows, int* num_cols, int *num_pieces_to_win);
void create_board(int num_rows, int num_cols, char*** board, int* turn);
void print_board(int num_rows, int num_cols, char** board);
void destroy_board(int num_rows, char*** board);
void play_game(int num_rows, int num_cols, int num_pieces_to_win, int turn, char** board);
void check_move();
void get_play(int num_rows, int num_cols, char** board, int* user_move);
void make_move(int num_rows, char**board, int user_move, char pieces);
bool play_is_valid(int num_cols, int num_rows, char** board, int user_move_num, int
user_move);
bool game_over(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool game_won(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool game_tied(int num_rows, int num_cols, int num_pieces_to_win, char**board);
bool row_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool col_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool diag_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool right_diag_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool left_diag_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
void read_args(int argc, char *argv[], int* num_rows, int* num_cols, int *num_pieces_to_win) {
//reads command input and ensures there are exactly three numbers
if (argc > 4) {
printf(\"Too many arguments entered\ \");
printf(\"Usage connectn.out num_rows num_columns
number_of_pieces_in_a_row_needed_to_win\");
exit(0);
}
else if (argc < 4) {
printf(\"Not enough arguments entered\ \");
printf(\"Usage connectn.out num_rows num_columns
number_of_pieces_in_a_row_needed_to_win\");
exit(0);
}
else { //puts user input into variables
sscanf(argv[1], \"%d\", &*num_rows);
sscanf(argv[2], \"%d\", &*num_cols);
sscanf(argv[3], \"%d\", &*num_pieces_to_win);
}
return;
}
void create_board (int num_rows, int num_cols, char*** board, int* turn) {
//set up the connect-n board
const char BLANK_SPACE = \'*\';
int i, j;
*turn = 0; //player 1 always goes first
*board = (char**)malloc(num_rows * sizeof(char*)); //creates pointers to the rows
for (i = 0; i < num_rows; ++i){ //for each row
(*board)[i] = (char*)malloc(num_cols * sizeof(char)); //create it
for (j = 0; j < num_cols; j++) { //fill in the row with blanks
(*board)[i][j] = BLANK_SPACE;
}
}
}
void print_board (int num_rows, int num_cols, char** board) {
//displays connect-n board
int i, j;
int k = 0;
for(i = 0; i < num_rows; i++){
printf(\"%d \", ((num_rows- i) - 1));
for(j = 0; j < num_cols; ++j){
printf(\"%c \", board[i][j]);
}
printf(\"\ \");
}
printf(\" %d \", k);
for(j = 1; j <.
Objectives Create a Java program using programming fundamentals (fi.docxamit657720
Objectives: Create a Java program using programming fundamentals (file I/O, loops, conditional statements, arrays, functions)
Problem: In an effort to win a coding competition, you decided to create an awesome Obstacle Warrior game. The game is played on a 2-dimensional board similar to a Chess board, but the dimensions may be different. The minimum size of the board is 2x2. The board will have a Start square and an Exit square that are not stored on the board. Start and Exit squares cannot be the same. Other board squares may contain obstacles in the form of an integer that will define how the warrior position and score will be affected. The obstacle squares can have values from 0 to -10 only. The Start square is always a clear square. All clear squares are marked with # on the board. The Exit square may contain an obstacle that is not a zero. The size of the board, number of obstacles, and Start and Exit squares are all unknow to your code prior to running. This information is stored in a file that your code will read at the beginning of the game. The board.dat file must be read into a 2-D array.
A warrior must start at the Start square and find their way to the Exit square. The warrior can move on the board in any direction including diagonally, one square at a time. A warrior has a running score (integer) maintained from the start of the game until the warrior exits the board. If the warrior lands on an obstacle square with a value of zero, the warrior is sent back to the starting position and the obstacle square will become a normal square (obstacle removed). If the obstacle square has a negative number, that number will reduce the warrior's score by the value of the obstacle, and the obstacle square will become a clear square (obstacle removed). Each VALID move that the warrior makes without landing on an obstacle will earn the warrior one point. The moves for the warrior are randomly generated by your code in the form of a direction (0-UP, 1-DOWN, 2-LEFT, 3-RIGHT, 4-UPRIGHT, 5-DOWNRIGHT, 6-UPLEFT, 7-DOWNLEFT). If the warrior is at the boundary of the board and your code generates an invalid move, that move will be ignored. Your code will keep generating moves until the warrior exits at the Exit square. Once the warrior exits, your program will store the updated board information to a new file ResultBoard.dat as single-space separated data. The program will also display the total number of valid moves, the total time elapsed in milliseconds since the first move until the warrior exited the board, the final score of the warrior and the formatted board information (right aligned columns with total of 5 spaces).
Output Format:
Each column in the final board display must be of total width of 5 spaces
Data in each column must be right aligned
Enter the board data file path: C:\board.dat //Repeat prompt until valid file OR show error and exit.
Type "Start" to start the game or "Exit" to exit the game: exit //Your program must exit
E.
C++You will design a program to play a simplified version of war, .pdfezzi97
C++
You will design a program to play a simplified version of war, using dice instead of cards. There
will be only one user, but 2 “players” for the game. The user will indicate the number of rounds
to play. The user will also specify for each “player” the number of sides on the dice used and if
that player is using regular or loaded dice. For example, one player could have a loaded 10-sided
die while the other has a 4-sided die. User should be able to determine how \"loaded\" the die is -
2/3/4 etc times mores likely to return a high number.
To play the game, for each round, you roll a die of the appropriate type for each player. The
higher result wins. If the results are equal, it is a draw. The winner of the game is the player who
won the most rounds. Your program will print out which player won to the user.
Die class: requires an input integer N which determines the number of sides on the individual
die. It includes a method to return a random integer between 1 and N as the result of rolling the
die for once.
LoadedDie class: it inherits the behavior and elements of Die, but the number it returns is biased
such that the average output of rolling it for several times will be higher than for a Die object.
You can determine how you want to realize the biased function.
Game class: it will implement the simple dice-rolling game. In the menu function, the user will
specify the die sides used by each player (the players can have dice with different number of
sides). The user will also indicate if either or both players are using loaded dice, and will enter
the number of rounds in the game. The Game class will create the necessary objects, play the
game, and display the results to the user. The output results should indicate the side and type
(loaded or not) of die used for each player, the number of rounds won by each player (in each
round, compare the rolling results, the larger number will win), and the final winner of the game
(the player that win more rounds).
Solution
//main.cpp
#include \"Game.hpp\"
#include
// Note: system(\"CLS\") works with win / visual studio. Use \"clear\" for *nix...
// change value in Game.hpp too!
#define CLEAR_SCREEN \"clear\"
int main(){
int sides, // how many sides the dice should have.
rounds, // how many rounds to play in the game.
p1isLoaded, // menu choice for if player 1 is using a loaded die.
p2isLoaded; // menu choice for if player 2 is using a loaded die.
bool p1Loaded, // converted menu choice for if player 1 is using a loaded die.
p2Loaded; // converted menu choice for if player 2 is using a loaded die.
// main menu
system(CLEAR_SCREEN);
do {
std::cout << std::endl;
std::cout << \"Welcome to a dice based game of War.\" << std::endl;
std::cout << \"Please choose the number of sides each die should\" << std::endl;
std::cout << \"have for this game, or enter \\\"5\\\" to quit.\" << std::endl << std::endl;
std::cout << \"1. Both dice will each have 4 sides.\" << std::endl;
std::cout << \"2. Both dice will .
Here is the code for youimport java.util.Scanner; import java.u.pdfanithareadymade
Here is the code for you:
import java.util.Scanner;
import java.util.Random;
public class TicTacToeGame {
static char[] [] board = new char[3][3];
static Scanner input=new Scanner(System.in);
//Object of Stats class to maintain statistics
static Stats stat = new Stats();
/**
* Prints the TicTacToe board
* @param arr: The board so far
*/
public static void printBoard(char [][] arr){
System.out.println();
for (int i=0; i<3; i++)
{
for (int j=0; j<3; j++)
{
System.out.print(arr[i][j]);
if(j!=2)
//Print the | for readable output
System.out.print(\" \" + \"|\" + \" \");
}
System.out.println();
if(i!=2) {
System.out.print(\"_ _ _ \"); // Print _ for readability
System.out.println();;
}
}
}
/**
* Clear the TicTacToe board before starting a new game
* @param arr: The board so far
*/
public static void clearBoard(char [][] arr){
for (int i=0; i<3; i++)
{
for (int j=0; j<3; j++)
{
arr[i][j]=\' \';
}
}
}
/** Determines if the player with the specified token wins
*
* @param symbol: Specifies whether the player is X or O
* @return true if player has won, false otherwise
*/
public static boolean isWon(char symbol) {
for (int i = 0; i < 3; i++) //horizontal
if (board[i][0] == symbol
&& board[i][1] == symbol
&& board[i][2] == symbol) {
return true;
}
//TODO!!! Also check for vertical and the two diagonals
for (int i = 0; i < 3; i++) //vertical
if (board[0][i] == symbol
&& board[1][i] == symbol
&& board[2][i] == symbol) {
return true;
}
//Leading diagonal
if (board[0][0] == symbol
&& board[1][1] == symbol
&& board[2][2] == symbol) {
return true;
}
//Trailing diagonal
if (board[0][2] == symbol
&& board[1][1] == symbol
&& board[2][0] == symbol) {
return true;
}
return false;
}
/** Determines if the cell is occupied
*
* @param row: Row of the cell to be checked
* @param col: Column of the cell to be checked
* @return true if the cell is occupied, false otherwise
*/
public static boolean isOccupied(int row, int col){
if (board[row][col]!=\' \') return false;
else return true;
}
/** Determines who starts the game
*/
public static int whoStarts(){
//TODO: Randomly chooses between 0 and 1 and returns the choice
return (int)(Math.random() + 0.5 );
}
/** takes care of the human\'s move
* 1. Prompt for a cell, then column
* 2. Puts a symbol (X or O) on the board
* 3. Prints the updated board
* 4. If a human wins: prints, updates stats and returns true
* 5. If not a win yet, returns false */
public static boolean humanTurn(char symbol){
//Prompt for a cell. User must enter
//row and column with a space in between.
System.out.print(\"\ \ Enter your move: (row column): \" );
int row = input.nextInt();
int col = input.nextInt();
//TODO!!! Mark user move in the board, print
//the board and check if user has won!
board[row][col] = symbol;
printBoard(board);
if(isWon(symbol))
return true;
return false;
}
/** takes care of the computer\'s move
* 1. Generates numbers until finds an empty cell
* 2. Puts a symbol (X or O) on the board
* 3. Prints the updated board
* 4. If a comp .
Please help with this. program must be written in C# .. All of the g.pdfmanjan6
Please help with this. program must be written in C# .. All of the game logic must be written in a
seperate class using using an array that is passed in through a prperty that represents the game
board. The class needs to have methods to determine of someone won, or if there was a tie,
make sure all business logic is in a seperate class anot behind the UI..
***** These are the complete in instructions for the game assignment design
Create a Tic-Tac-Toe game that can be played by two players. The form will consist of a Tic-
Tac-Toe board in which the users’ click on to choose their space. As the game is being played
the Game Status section will tell whose turn it is. When someone wins or there is a tie, a message
will be displayed in the Game status section telling the users the status. When someone wins the
game the winning move needs to be indicated. There also needs to be a section that keeps track
of the number of wins for each player, and the number of ties. When the game is finished the
user may click the “Start Game” button to start a new game.
This program will consist of the main form and at least one class that will define the rules of the
game. This class will have an array that is passed in through a property that represents the game
board. The class will then have methods within it that determines if someone won, if there is a
tie, or if neither has occurred yet. Make sure all business logic is in a separate class and not
behind the UI.
EXTRA CREDIT (10 Points)
Create a computer player that can be played against. The computer player will need to be smart
enough to make a winning move or to block a winning move.
Solution
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace Tic_Tac_Toe
{
///
/// Description of MainForm.
///
public partial class MainForm : Form
{
Logic logicObj = new Logic();
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
int turn=1;
int click1=0,click2=0,click3=0,click4=0,click5=0,click6=0,click7=0,click8=0,click9=0;
int player1=0,player2=0;
void Button1Click(object sender, EventArgs e)
{
if(click1==0)
{
if(turn%2!=0)
{
button1.Text=\"X\";
click1++;
}
else
{
button1.Text=\"O\";
click1++;
}
turn++;
}
else
{
button1.Text=button1.Text;
}
display();
int a = logicObj.winLossFunc(button1.Text, button2.Text, button3.Text, button4.Text,
button5.Text, button6.Text, button7.Text, button8.Text, button9.Text);
if (a==1)
{
player1++;
player1score.Text = player1.ToString();
cleargame();
}
else if(a==2)
{
player2++;
player2score.Text = player2.ToString();
cleargame();
}
}
void Button2Click(object sender, EventArgs e)
{
if(click2==0)
{
if(turn%2!=0)
{
button2.Text=\"X\";
click2++;
}
else
{
button2.Text=\"O\";
click2++;
}
turn++;
}
else
{
button2.Text=button2.Text;
}
display();
int a = logicObj.winLossFunc(button1.Text, b.
Write a program in java in which you will build the“Sink theShipsGam.pdfarchanenterprises
Write a program in java in which you will build the“Sink theShipsGame”. The Game has a8 x 8
grid and threeships. Each ship takes up exactly three cells. In the game, it’s you against
thecomputer, but unlike the real battleship game, you don’t place any ships on yourown. Instead,
your job is to sink the computer’s ship in the fewest number of guess.
Goal:Sink all the computer’s ships(three in this case)in the fewest number ofguesses. You’re
given a rating or level, based on how well you perform.Setup:When the game program is
launched, the computerplaces three ships on a8x 8 grid(for an example, see the figure
below).The ships can be placed eithervertically or horizontally (no other placement is valid)on
empty cells of the grid.When that’scomplete the game asks for your first guess.
The computer will prompt you to enter a guess(a cell), that you will type at the command-line as
“1 3”(where “1 3” means 3rdcell ofthe 1strow), “45”, etc.. In response to your guess, you will
see a result at thecommand line,either “Hit”, “Miss”, “Kill” (or whatever the lucky battleship of
the dayis!). When you have sank all three battleships, the game ends by printing out your rating.
Here is a sample run of the game:
Your goal is to sink three ships.
Battleship1, Battleship2, Battleship3
Try to sink them all in the fewest number of guesses
Enter a guess [row (1 to 8)] [col (1 to 8)]: 1 3
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 2 1
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 2 2
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 1
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 1
kill
Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 3
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 1 7
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 3
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 4
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 5
kill
Enter a guess [row (1 to 8)] [col (1 to 8)]: 5 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 6 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 61 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 6 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 4
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 5
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 6
kill
All Ships are sank!
It only took you 18 guesses.
You got out before your options sank.
When player can finish the game within 20 guesses, print the following message
(where xx is the number of guesses):
All Ships are sank!
It only took you XX guesses.
You got out before your options sank.
If it takes more than 20 guesses, print the following message
All Ships are sank!
Took you long enough. XX guesses.
Fish are dancing with your options.
The java program should terminate after 25 guesses and it should reveal the
positions of the ships and their status.
Solution
Please follow the code and comments for description :
CODE :
import java.util.Random; // required imports for the code
imp.
You will write a multi-interface version of the well-known concentra.pdfFashionColZone
You will write a multi-interface version of the well-known concentration game: 1. The game
displays a grid of upper-case letters, with each letter appearing twice. 2. A player has a few
seconds to memorize the letters before they disappear. 3. The player then has to remember where
each pair was located.
line, then MultiConcentration starts with the text interface.
First the new game display will show the user the pairs he/she must guess, in a format similar to
the following example for size = 6
D H B C M I
H G K K A R
C N R E O E
Q O A Q L F
L F J P B G
P D N M I J
Memorize the above grid!
Note that the new game display uses pairs of distinct single uppercase capital letters distributed
at random on a square grid, starting at A and continuing until the grid is full.
This new game display shows for 10 seconds, after which it scrolls out of view. (To scroll it just
write about 25 newlines.) Then the standard game display appears.
The standard game display will look like the following example for size = 6
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20 21 22 23 24
25 26 27 28 29 30
21 32 33 34 35 36
Enter a pair of numbers, or \"R\" to reset, or \"Q\" to quit:
reset, or \"Q\" to quit:
If the player makes an invalid entry (e.g. numbers out of range, number already guessed, no
blank separator, etc.) then a \"please reenter\" message is printed and the same display is shown
again.
If the player makes a bad guess, then a \"Sorry...\" message is printed and the same display is
shown again.
If the player enters an \"R\" for reset, then we start over, that is, the computer calculates a new
set of pairs and shows the new game display again.
If the player enters a \"Q\" for quit, then the game prints a \"Game Over\" message and ends.
3.4 Graphic Game Interface
If the player used the \"-g\" flag on the startup command line then MultiConcentration starts up
with the graphic interface.
You may design the graphic interface as you choose, as long as you use Swing and preserve the
steps in the game as described in the previous section.
One possible graphic interface is shown in Figure 1. In this design the new game display and the
standard game display have been replaced by a grid of buttons. Instead of entering pairs of
numbers, the player clicks on two of the buttons. The \"reset\" and \"quit\" commands are given
using a menu. Letters that have been correctly guessed are shown with a pink background color.
Messages to the player are shown in a text area under the grid.
4 GENERAL REQUIREMENTS
4.1 Design Requirements
Design your program with GUI classes, a main class, and Application Logic / Data classes as
described in my overheads on Design for Testability.
Do not use a package statement; name the main class MultiConcentration. (Otherwise the
startup command given in 3.1 would not work.)
You should have at least 5 classes, and not one of them should have more than 40% of the code.
Solution
import java.io.OutputStream;
import java.io.PrintStream;
public cl.
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...ssuserd6b1fd
C++ programming language notes for beginners and Collage students. Written for beginners. Colored graphics. Function by Function explanation with complete examples. Well commented examples. Illustrations are made available for data dealing at memory level.
02 of 02 parts,
Get Part 1 from https://www.slideshare.net/ArunUmrao/introduction-to-c-programming-for-beginners-by-arunumrao-1-of-2
Introduction to c++ programming, Introduction to c++ programming, Introduction to c++ programming, Introduction to c++ programming,
1.) Main characteristics of Haloarchaea are as followsHalophiles .pdfinfo382133
1.) Main characteristics of Haloarchaea are as follows:
Halophiles cope up with the osmotic stress through accumulating high salt concentration within
the cytoplasm. This helps in achieving isosmotic balance with the surrounding and maintains the
cell volume. For this purpose the halophiles have some compatible solutes or osmolytes such as
glycerol, sucrose, ecotine, amino acids etc. which accumulate in them without effecting the pH
and metabolic processes. Some halobacteria accumulate potassium chloride to compensate he
outside present sodium chloride salt. The compatible solutes are obtained by biosynthesis,
storage materials or from the medium present outside.
2.) Rhodopsins are retinal binding proteins that acts as light dependent ion transport pump which
uses light energy to move protons outside the membrane. They include bacteriorhodopsin,
archaerhodopsin, halorhodopsin and sensory rhodopsin.
Functions of rhodopsins are as follows:
The importance of rhodopsins are as follows:
Solution
1.) Main characteristics of Haloarchaea are as follows:
Halophiles cope up with the osmotic stress through accumulating high salt concentration within
the cytoplasm. This helps in achieving isosmotic balance with the surrounding and maintains the
cell volume. For this purpose the halophiles have some compatible solutes or osmolytes such as
glycerol, sucrose, ecotine, amino acids etc. which accumulate in them without effecting the pH
and metabolic processes. Some halobacteria accumulate potassium chloride to compensate he
outside present sodium chloride salt. The compatible solutes are obtained by biosynthesis,
storage materials or from the medium present outside.
2.) Rhodopsins are retinal binding proteins that acts as light dependent ion transport pump which
uses light energy to move protons outside the membrane. They include bacteriorhodopsin,
archaerhodopsin, halorhodopsin and sensory rhodopsin.
Functions of rhodopsins are as follows:
The importance of rhodopsins are as follows:.
1. The three bacteria that may be implicated in the given case are S.pdfinfo382133
1. The three bacteria that may be implicated in the given case are Staphylococcus aureus,
Haemophilus parainfluenzae, Cardiobacterium hominis . These organisms generally occur in the
saliva as normal flora. However, drug users who lick the blood on syringes ingest them and thus,
they can casue polymicrobial endocarditis.
2. Cardiobacterium hominis is Gram negative bacillus that occurs as normal flora of mouth and
upper respiratory tract. The bacterium is grouped into HACEK group. The organism can cause
inflammation of heart valves. It produces beta lactamases
Haemophilus parainfluenzae: Gram negative, pleomorphic, facultative anaerobes. The organism
is mostly assocaited with upper respiratory tract infections and mitral valve inflammation. The
organism is generally found in coinfection with Streptococcus.
Cardiobacterium hominis: It is a Gram negative bacillus of HACEK group. It is part of normal
flora of upper respiratory tract and mouth.
These organisms are generally harmless, and occur as secondary infection. When there is a
disturbance to the mucosal surface, they gain access and enter the tissues. They cause infections
at abnormal tissues of heart like damages valves, in particular. They initiate an inflammatory
response.
3. The organisms are normally present as flora in the host. The patient acquired these bacteria
due to the use of syringe drugs. Licking of the blood on the syringe, and sterilizing the syringe by
licking makes the organism enter the sytem.
Solution
1. The three bacteria that may be implicated in the given case are Staphylococcus aureus,
Haemophilus parainfluenzae, Cardiobacterium hominis . These organisms generally occur in the
saliva as normal flora. However, drug users who lick the blood on syringes ingest them and thus,
they can casue polymicrobial endocarditis.
2. Cardiobacterium hominis is Gram negative bacillus that occurs as normal flora of mouth and
upper respiratory tract. The bacterium is grouped into HACEK group. The organism can cause
inflammation of heart valves. It produces beta lactamases
Haemophilus parainfluenzae: Gram negative, pleomorphic, facultative anaerobes. The organism
is mostly assocaited with upper respiratory tract infections and mitral valve inflammation. The
organism is generally found in coinfection with Streptococcus.
Cardiobacterium hominis: It is a Gram negative bacillus of HACEK group. It is part of normal
flora of upper respiratory tract and mouth.
These organisms are generally harmless, and occur as secondary infection. When there is a
disturbance to the mucosal surface, they gain access and enter the tissues. They cause infections
at abnormal tissues of heart like damages valves, in particular. They initiate an inflammatory
response.
3. The organisms are normally present as flora in the host. The patient acquired these bacteria
due to the use of syringe drugs. Licking of the blood on the syringe, and sterilizing the syringe by
licking makes the organism enter the sytem..
1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdfinfo382133
1. Pros and Cons of IP CCTV:
New threats are introduced to the security world as systems migrate from traditional analogue to
IP network-enabled systems particularly in video surveillance. Internet Protocol (IP) provide an
open platform for integration at the data level of multiple security and life safety devices and
applications.
Pros:
Lower initial cost: Harnissing the IT infrastructure reduces installation costs in cabling,
associated containment and power outlets.
Wide-spread compatibility
Provides flexibility and scalability
Higher security and resilience
The tight software integraion between systems make them more intelligent and reduces security
gaps, speed up the response time.
Cons:
It revolves arond network security and hackers threat.
The risk increases if camera is accesses from the mobile or phone.
Threat to the security industry and thus security from the IT sector.
2.
3. User education about security:
It is one of the hardest security layers for administrators to implement.Some of the tips are:
4. There are many problems associated with the boimetrics like fingerprints, iris patterns, face
scan, voice recognization. Make sure that the biometric data is a sensitive data compared to
others and is encrypted in transit from the biometrics device to the directory or database housing
the authentication credentials. Some biometrics readers are on USB keys or tokens that connect
to the computer. These devices should provide encryption.
Either at rest or in transit, the key to protecting biometric data is encryption and then secure
storage in a directory service such as AD or LDAP.
5. Organizations need to take pro-active steps to define the accetable use of portable storage
devices like USB flash drives within the environment and then put the tools and technology in
place to help monitor and enforce the policy and protect the network and data from the risk
caused by USB flash drives. Many organizations have an acceptable use policy defined, which
users must agree to. The Acceptable Use Policy (AUP) essentially defines how users are allowed
to use the internet, e-mail, telephones and other cmmunications and network resources.
The Group policy is an effective tool for computer on the network and enforcing the security
policies.
Solution
1. Pros and Cons of IP CCTV:
New threats are introduced to the security world as systems migrate from traditional analogue to
IP network-enabled systems particularly in video surveillance. Internet Protocol (IP) provide an
open platform for integration at the data level of multiple security and life safety devices and
applications.
Pros:
Lower initial cost: Harnissing the IT infrastructure reduces installation costs in cabling,
associated containment and power outlets.
Wide-spread compatibility
Provides flexibility and scalability
Higher security and resilience
The tight software integraion between systems make them more intelligent and reduces security
gaps, speed up the response time.
Cons:
It revolves.
1. Activation of Vit. D involves Kidney and Liver and liver is part .pdfinfo382133
1. Activation of Vit. D involves Kidney and Liver and liver is part of Digestive system. Answer
is Digestive system
2. Calcium homeostasis and phosphate homeostasis are intimately tied to each other for two
reasons. First, calcium and phosphate are the principal components of hydroxyapatite crystals
[Ca10(PO4)6(OH)2)], which by far constitute the major portion of the mineral phase of bone.
Second, they are regulated by the same hormones, primarily parathyroid hormone (PTH) and
1,25-dihydroxyvitamin D (calcitriol) and, to a lesser extent, the hormone calcitonin. These
hormones act on three organ systems-the bone, the kidneys, and the gastrointestinal (GI) tract-to
control the levels of these two ions in plasma. Answer is Endocrine system
3. Answer is Muscular system
4. Nonspecific defenses include mechanical barriers such as skin, saliva, the lacrimal apparatus,
and mucous membranes, as well as the outward flow of urine, vaginal secretions, and blood
(from wounds). Phagocytosis, fever, inflammation, and molecular strategies. Answer is
Integumentary System
5. Answer is the Circulatory system, Renal artery perfusion pressure directly regulates sodium
excretion-a process known as pressure natriuresis-and influences the activity of various
vasoactive systems such as the renin-angiotensin-aldosterone system.
6. Erythropoietin is a glycoprotein hormone produced in the kidney that acts on erythroid
progenitor cells in the bone marrow. Answer is Skeleton system
7. When the animal is in a situation of crisis or stress blood flow to the kidneys is reduced for the
sake of other organs such as the brain, heart and skeletal muscles. The sympathetic nervous
system and a heightened level of adrenalin in the plasma cause the contraction of both the
afferant and efferant arterioles. Answer is Nervous System
Solution
1. Activation of Vit. D involves Kidney and Liver and liver is part of Digestive system. Answer
is Digestive system
2. Calcium homeostasis and phosphate homeostasis are intimately tied to each other for two
reasons. First, calcium and phosphate are the principal components of hydroxyapatite crystals
[Ca10(PO4)6(OH)2)], which by far constitute the major portion of the mineral phase of bone.
Second, they are regulated by the same hormones, primarily parathyroid hormone (PTH) and
1,25-dihydroxyvitamin D (calcitriol) and, to a lesser extent, the hormone calcitonin. These
hormones act on three organ systems-the bone, the kidneys, and the gastrointestinal (GI) tract-to
control the levels of these two ions in plasma. Answer is Endocrine system
3. Answer is Muscular system
4. Nonspecific defenses include mechanical barriers such as skin, saliva, the lacrimal apparatus,
and mucous membranes, as well as the outward flow of urine, vaginal secretions, and blood
(from wounds). Phagocytosis, fever, inflammation, and molecular strategies. Answer is
Integumentary System
5. Answer is the Circulatory system, Renal artery perfusion pressure directly regulates sodium
.
Rf = (distance the spot traveled)L there are fou.pdfinfo382133
Rf = (distance the spot traveled)/L there are four spots, so from the left to the right:
Rf = 0.15 Rf = 0.40 Rf = 0.62 Rf = 0.87
Solution
Rf = (distance the spot traveled)/L there are four spots, so from the left to the right:
Rf = 0.15 Rf = 0.40 Rf = 0.62 Rf = 0.87.
More Related Content
Similar to Please follow the data 1) For Line 23 In the IF - Condition yo.pdf
The following is my code for a connectn program. When I run my code .pdfeyelineoptics
The following is my code for a connectn program. When I run my code in the tester, I failed two
out 10 tests. I was hoping for some help in finding what causes these errors. I have included the
homework prompt and test failed results. Thank you so much!
#include
#include
#include
void read_args(int argc, char *argv[], int* num_rows, int* num_cols, int *num_pieces_to_win);
void create_board(int num_rows, int num_cols, char*** board, int* turn);
void print_board(int num_rows, int num_cols, char** board);
void destroy_board(int num_rows, char*** board);
void play_game(int num_rows, int num_cols, int num_pieces_to_win, int turn, char** board);
void check_move();
void get_play(int num_rows, int num_cols, char** board, int* user_move);
void make_move(int num_rows, char**board, int user_move, char pieces);
bool play_is_valid(int num_cols, int num_rows, char** board, int user_move_num, int
user_move);
bool game_over(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool game_won(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool game_tied(int num_rows, int num_cols, int num_pieces_to_win, char**board);
bool row_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool col_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool diag_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool right_diag_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
bool left_diag_win(int num_rows, int num_cols, int num_pieces_to_win, char** board);
void read_args(int argc, char *argv[], int* num_rows, int* num_cols, int *num_pieces_to_win) {
//reads command input and ensures there are exactly three numbers
if (argc > 4) {
printf(\"Too many arguments entered\ \");
printf(\"Usage connectn.out num_rows num_columns
number_of_pieces_in_a_row_needed_to_win\");
exit(0);
}
else if (argc < 4) {
printf(\"Not enough arguments entered\ \");
printf(\"Usage connectn.out num_rows num_columns
number_of_pieces_in_a_row_needed_to_win\");
exit(0);
}
else { //puts user input into variables
sscanf(argv[1], \"%d\", &*num_rows);
sscanf(argv[2], \"%d\", &*num_cols);
sscanf(argv[3], \"%d\", &*num_pieces_to_win);
}
return;
}
void create_board (int num_rows, int num_cols, char*** board, int* turn) {
//set up the connect-n board
const char BLANK_SPACE = \'*\';
int i, j;
*turn = 0; //player 1 always goes first
*board = (char**)malloc(num_rows * sizeof(char*)); //creates pointers to the rows
for (i = 0; i < num_rows; ++i){ //for each row
(*board)[i] = (char*)malloc(num_cols * sizeof(char)); //create it
for (j = 0; j < num_cols; j++) { //fill in the row with blanks
(*board)[i][j] = BLANK_SPACE;
}
}
}
void print_board (int num_rows, int num_cols, char** board) {
//displays connect-n board
int i, j;
int k = 0;
for(i = 0; i < num_rows; i++){
printf(\"%d \", ((num_rows- i) - 1));
for(j = 0; j < num_cols; ++j){
printf(\"%c \", board[i][j]);
}
printf(\"\ \");
}
printf(\" %d \", k);
for(j = 1; j <.
Objectives Create a Java program using programming fundamentals (fi.docxamit657720
Objectives: Create a Java program using programming fundamentals (file I/O, loops, conditional statements, arrays, functions)
Problem: In an effort to win a coding competition, you decided to create an awesome Obstacle Warrior game. The game is played on a 2-dimensional board similar to a Chess board, but the dimensions may be different. The minimum size of the board is 2x2. The board will have a Start square and an Exit square that are not stored on the board. Start and Exit squares cannot be the same. Other board squares may contain obstacles in the form of an integer that will define how the warrior position and score will be affected. The obstacle squares can have values from 0 to -10 only. The Start square is always a clear square. All clear squares are marked with # on the board. The Exit square may contain an obstacle that is not a zero. The size of the board, number of obstacles, and Start and Exit squares are all unknow to your code prior to running. This information is stored in a file that your code will read at the beginning of the game. The board.dat file must be read into a 2-D array.
A warrior must start at the Start square and find their way to the Exit square. The warrior can move on the board in any direction including diagonally, one square at a time. A warrior has a running score (integer) maintained from the start of the game until the warrior exits the board. If the warrior lands on an obstacle square with a value of zero, the warrior is sent back to the starting position and the obstacle square will become a normal square (obstacle removed). If the obstacle square has a negative number, that number will reduce the warrior's score by the value of the obstacle, and the obstacle square will become a clear square (obstacle removed). Each VALID move that the warrior makes without landing on an obstacle will earn the warrior one point. The moves for the warrior are randomly generated by your code in the form of a direction (0-UP, 1-DOWN, 2-LEFT, 3-RIGHT, 4-UPRIGHT, 5-DOWNRIGHT, 6-UPLEFT, 7-DOWNLEFT). If the warrior is at the boundary of the board and your code generates an invalid move, that move will be ignored. Your code will keep generating moves until the warrior exits at the Exit square. Once the warrior exits, your program will store the updated board information to a new file ResultBoard.dat as single-space separated data. The program will also display the total number of valid moves, the total time elapsed in milliseconds since the first move until the warrior exited the board, the final score of the warrior and the formatted board information (right aligned columns with total of 5 spaces).
Output Format:
Each column in the final board display must be of total width of 5 spaces
Data in each column must be right aligned
Enter the board data file path: C:\board.dat //Repeat prompt until valid file OR show error and exit.
Type "Start" to start the game or "Exit" to exit the game: exit //Your program must exit
E.
C++You will design a program to play a simplified version of war, .pdfezzi97
C++
You will design a program to play a simplified version of war, using dice instead of cards. There
will be only one user, but 2 “players” for the game. The user will indicate the number of rounds
to play. The user will also specify for each “player” the number of sides on the dice used and if
that player is using regular or loaded dice. For example, one player could have a loaded 10-sided
die while the other has a 4-sided die. User should be able to determine how \"loaded\" the die is -
2/3/4 etc times mores likely to return a high number.
To play the game, for each round, you roll a die of the appropriate type for each player. The
higher result wins. If the results are equal, it is a draw. The winner of the game is the player who
won the most rounds. Your program will print out which player won to the user.
Die class: requires an input integer N which determines the number of sides on the individual
die. It includes a method to return a random integer between 1 and N as the result of rolling the
die for once.
LoadedDie class: it inherits the behavior and elements of Die, but the number it returns is biased
such that the average output of rolling it for several times will be higher than for a Die object.
You can determine how you want to realize the biased function.
Game class: it will implement the simple dice-rolling game. In the menu function, the user will
specify the die sides used by each player (the players can have dice with different number of
sides). The user will also indicate if either or both players are using loaded dice, and will enter
the number of rounds in the game. The Game class will create the necessary objects, play the
game, and display the results to the user. The output results should indicate the side and type
(loaded or not) of die used for each player, the number of rounds won by each player (in each
round, compare the rolling results, the larger number will win), and the final winner of the game
(the player that win more rounds).
Solution
//main.cpp
#include \"Game.hpp\"
#include
// Note: system(\"CLS\") works with win / visual studio. Use \"clear\" for *nix...
// change value in Game.hpp too!
#define CLEAR_SCREEN \"clear\"
int main(){
int sides, // how many sides the dice should have.
rounds, // how many rounds to play in the game.
p1isLoaded, // menu choice for if player 1 is using a loaded die.
p2isLoaded; // menu choice for if player 2 is using a loaded die.
bool p1Loaded, // converted menu choice for if player 1 is using a loaded die.
p2Loaded; // converted menu choice for if player 2 is using a loaded die.
// main menu
system(CLEAR_SCREEN);
do {
std::cout << std::endl;
std::cout << \"Welcome to a dice based game of War.\" << std::endl;
std::cout << \"Please choose the number of sides each die should\" << std::endl;
std::cout << \"have for this game, or enter \\\"5\\\" to quit.\" << std::endl << std::endl;
std::cout << \"1. Both dice will each have 4 sides.\" << std::endl;
std::cout << \"2. Both dice will .
Here is the code for youimport java.util.Scanner; import java.u.pdfanithareadymade
Here is the code for you:
import java.util.Scanner;
import java.util.Random;
public class TicTacToeGame {
static char[] [] board = new char[3][3];
static Scanner input=new Scanner(System.in);
//Object of Stats class to maintain statistics
static Stats stat = new Stats();
/**
* Prints the TicTacToe board
* @param arr: The board so far
*/
public static void printBoard(char [][] arr){
System.out.println();
for (int i=0; i<3; i++)
{
for (int j=0; j<3; j++)
{
System.out.print(arr[i][j]);
if(j!=2)
//Print the | for readable output
System.out.print(\" \" + \"|\" + \" \");
}
System.out.println();
if(i!=2) {
System.out.print(\"_ _ _ \"); // Print _ for readability
System.out.println();;
}
}
}
/**
* Clear the TicTacToe board before starting a new game
* @param arr: The board so far
*/
public static void clearBoard(char [][] arr){
for (int i=0; i<3; i++)
{
for (int j=0; j<3; j++)
{
arr[i][j]=\' \';
}
}
}
/** Determines if the player with the specified token wins
*
* @param symbol: Specifies whether the player is X or O
* @return true if player has won, false otherwise
*/
public static boolean isWon(char symbol) {
for (int i = 0; i < 3; i++) //horizontal
if (board[i][0] == symbol
&& board[i][1] == symbol
&& board[i][2] == symbol) {
return true;
}
//TODO!!! Also check for vertical and the two diagonals
for (int i = 0; i < 3; i++) //vertical
if (board[0][i] == symbol
&& board[1][i] == symbol
&& board[2][i] == symbol) {
return true;
}
//Leading diagonal
if (board[0][0] == symbol
&& board[1][1] == symbol
&& board[2][2] == symbol) {
return true;
}
//Trailing diagonal
if (board[0][2] == symbol
&& board[1][1] == symbol
&& board[2][0] == symbol) {
return true;
}
return false;
}
/** Determines if the cell is occupied
*
* @param row: Row of the cell to be checked
* @param col: Column of the cell to be checked
* @return true if the cell is occupied, false otherwise
*/
public static boolean isOccupied(int row, int col){
if (board[row][col]!=\' \') return false;
else return true;
}
/** Determines who starts the game
*/
public static int whoStarts(){
//TODO: Randomly chooses between 0 and 1 and returns the choice
return (int)(Math.random() + 0.5 );
}
/** takes care of the human\'s move
* 1. Prompt for a cell, then column
* 2. Puts a symbol (X or O) on the board
* 3. Prints the updated board
* 4. If a human wins: prints, updates stats and returns true
* 5. If not a win yet, returns false */
public static boolean humanTurn(char symbol){
//Prompt for a cell. User must enter
//row and column with a space in between.
System.out.print(\"\ \ Enter your move: (row column): \" );
int row = input.nextInt();
int col = input.nextInt();
//TODO!!! Mark user move in the board, print
//the board and check if user has won!
board[row][col] = symbol;
printBoard(board);
if(isWon(symbol))
return true;
return false;
}
/** takes care of the computer\'s move
* 1. Generates numbers until finds an empty cell
* 2. Puts a symbol (X or O) on the board
* 3. Prints the updated board
* 4. If a comp .
Please help with this. program must be written in C# .. All of the g.pdfmanjan6
Please help with this. program must be written in C# .. All of the game logic must be written in a
seperate class using using an array that is passed in through a prperty that represents the game
board. The class needs to have methods to determine of someone won, or if there was a tie,
make sure all business logic is in a seperate class anot behind the UI..
***** These are the complete in instructions for the game assignment design
Create a Tic-Tac-Toe game that can be played by two players. The form will consist of a Tic-
Tac-Toe board in which the users’ click on to choose their space. As the game is being played
the Game Status section will tell whose turn it is. When someone wins or there is a tie, a message
will be displayed in the Game status section telling the users the status. When someone wins the
game the winning move needs to be indicated. There also needs to be a section that keeps track
of the number of wins for each player, and the number of ties. When the game is finished the
user may click the “Start Game” button to start a new game.
This program will consist of the main form and at least one class that will define the rules of the
game. This class will have an array that is passed in through a property that represents the game
board. The class will then have methods within it that determines if someone won, if there is a
tie, or if neither has occurred yet. Make sure all business logic is in a separate class and not
behind the UI.
EXTRA CREDIT (10 Points)
Create a computer player that can be played against. The computer player will need to be smart
enough to make a winning move or to block a winning move.
Solution
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace Tic_Tac_Toe
{
///
/// Description of MainForm.
///
public partial class MainForm : Form
{
Logic logicObj = new Logic();
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
int turn=1;
int click1=0,click2=0,click3=0,click4=0,click5=0,click6=0,click7=0,click8=0,click9=0;
int player1=0,player2=0;
void Button1Click(object sender, EventArgs e)
{
if(click1==0)
{
if(turn%2!=0)
{
button1.Text=\"X\";
click1++;
}
else
{
button1.Text=\"O\";
click1++;
}
turn++;
}
else
{
button1.Text=button1.Text;
}
display();
int a = logicObj.winLossFunc(button1.Text, button2.Text, button3.Text, button4.Text,
button5.Text, button6.Text, button7.Text, button8.Text, button9.Text);
if (a==1)
{
player1++;
player1score.Text = player1.ToString();
cleargame();
}
else if(a==2)
{
player2++;
player2score.Text = player2.ToString();
cleargame();
}
}
void Button2Click(object sender, EventArgs e)
{
if(click2==0)
{
if(turn%2!=0)
{
button2.Text=\"X\";
click2++;
}
else
{
button2.Text=\"O\";
click2++;
}
turn++;
}
else
{
button2.Text=button2.Text;
}
display();
int a = logicObj.winLossFunc(button1.Text, b.
Write a program in java in which you will build the“Sink theShipsGam.pdfarchanenterprises
Write a program in java in which you will build the“Sink theShipsGame”. The Game has a8 x 8
grid and threeships. Each ship takes up exactly three cells. In the game, it’s you against
thecomputer, but unlike the real battleship game, you don’t place any ships on yourown. Instead,
your job is to sink the computer’s ship in the fewest number of guess.
Goal:Sink all the computer’s ships(three in this case)in the fewest number ofguesses. You’re
given a rating or level, based on how well you perform.Setup:When the game program is
launched, the computerplaces three ships on a8x 8 grid(for an example, see the figure
below).The ships can be placed eithervertically or horizontally (no other placement is valid)on
empty cells of the grid.When that’scomplete the game asks for your first guess.
The computer will prompt you to enter a guess(a cell), that you will type at the command-line as
“1 3”(where “1 3” means 3rdcell ofthe 1strow), “45”, etc.. In response to your guess, you will
see a result at thecommand line,either “Hit”, “Miss”, “Kill” (or whatever the lucky battleship of
the dayis!). When you have sank all three battleships, the game ends by printing out your rating.
Here is a sample run of the game:
Your goal is to sink three ships.
Battleship1, Battleship2, Battleship3
Try to sink them all in the fewest number of guesses
Enter a guess [row (1 to 8)] [col (1 to 8)]: 1 3
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 2 1
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 2 2
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 1
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 1
kill
Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 3
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 1 7
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 3
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 4
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 4 5
kill
Enter a guess [row (1 to 8)] [col (1 to 8)]: 5 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 3 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 6 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 61 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 6 1
miss
Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 4
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 5
hit
Enter a guess [row (1 to 8)] [col (1 to 8)]: 8 6
kill
All Ships are sank!
It only took you 18 guesses.
You got out before your options sank.
When player can finish the game within 20 guesses, print the following message
(where xx is the number of guesses):
All Ships are sank!
It only took you XX guesses.
You got out before your options sank.
If it takes more than 20 guesses, print the following message
All Ships are sank!
Took you long enough. XX guesses.
Fish are dancing with your options.
The java program should terminate after 25 guesses and it should reveal the
positions of the ships and their status.
Solution
Please follow the code and comments for description :
CODE :
import java.util.Random; // required imports for the code
imp.
You will write a multi-interface version of the well-known concentra.pdfFashionColZone
You will write a multi-interface version of the well-known concentration game: 1. The game
displays a grid of upper-case letters, with each letter appearing twice. 2. A player has a few
seconds to memorize the letters before they disappear. 3. The player then has to remember where
each pair was located.
line, then MultiConcentration starts with the text interface.
First the new game display will show the user the pairs he/she must guess, in a format similar to
the following example for size = 6
D H B C M I
H G K K A R
C N R E O E
Q O A Q L F
L F J P B G
P D N M I J
Memorize the above grid!
Note that the new game display uses pairs of distinct single uppercase capital letters distributed
at random on a square grid, starting at A and continuing until the grid is full.
This new game display shows for 10 seconds, after which it scrolls out of view. (To scroll it just
write about 25 newlines.) Then the standard game display appears.
The standard game display will look like the following example for size = 6
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20 21 22 23 24
25 26 27 28 29 30
21 32 33 34 35 36
Enter a pair of numbers, or \"R\" to reset, or \"Q\" to quit:
reset, or \"Q\" to quit:
If the player makes an invalid entry (e.g. numbers out of range, number already guessed, no
blank separator, etc.) then a \"please reenter\" message is printed and the same display is shown
again.
If the player makes a bad guess, then a \"Sorry...\" message is printed and the same display is
shown again.
If the player enters an \"R\" for reset, then we start over, that is, the computer calculates a new
set of pairs and shows the new game display again.
If the player enters a \"Q\" for quit, then the game prints a \"Game Over\" message and ends.
3.4 Graphic Game Interface
If the player used the \"-g\" flag on the startup command line then MultiConcentration starts up
with the graphic interface.
You may design the graphic interface as you choose, as long as you use Swing and preserve the
steps in the game as described in the previous section.
One possible graphic interface is shown in Figure 1. In this design the new game display and the
standard game display have been replaced by a grid of buttons. Instead of entering pairs of
numbers, the player clicks on two of the buttons. The \"reset\" and \"quit\" commands are given
using a menu. Letters that have been correctly guessed are shown with a pink background color.
Messages to the player are shown in a text area under the grid.
4 GENERAL REQUIREMENTS
4.1 Design Requirements
Design your program with GUI classes, a main class, and Application Logic / Data classes as
described in my overheads on Design for Testability.
Do not use a package statement; name the main class MultiConcentration. (Otherwise the
startup command given in 3.1 would not work.)
You should have at least 5 classes, and not one of them should have more than 40% of the code.
Solution
import java.io.OutputStream;
import java.io.PrintStream;
public cl.
Notes for C++ Programming / Object Oriented C++ Programming for MCA, BCA and ...ssuserd6b1fd
C++ programming language notes for beginners and Collage students. Written for beginners. Colored graphics. Function by Function explanation with complete examples. Well commented examples. Illustrations are made available for data dealing at memory level.
02 of 02 parts,
Get Part 1 from https://www.slideshare.net/ArunUmrao/introduction-to-c-programming-for-beginners-by-arunumrao-1-of-2
Introduction to c++ programming, Introduction to c++ programming, Introduction to c++ programming, Introduction to c++ programming,
1.) Main characteristics of Haloarchaea are as followsHalophiles .pdfinfo382133
1.) Main characteristics of Haloarchaea are as follows:
Halophiles cope up with the osmotic stress through accumulating high salt concentration within
the cytoplasm. This helps in achieving isosmotic balance with the surrounding and maintains the
cell volume. For this purpose the halophiles have some compatible solutes or osmolytes such as
glycerol, sucrose, ecotine, amino acids etc. which accumulate in them without effecting the pH
and metabolic processes. Some halobacteria accumulate potassium chloride to compensate he
outside present sodium chloride salt. The compatible solutes are obtained by biosynthesis,
storage materials or from the medium present outside.
2.) Rhodopsins are retinal binding proteins that acts as light dependent ion transport pump which
uses light energy to move protons outside the membrane. They include bacteriorhodopsin,
archaerhodopsin, halorhodopsin and sensory rhodopsin.
Functions of rhodopsins are as follows:
The importance of rhodopsins are as follows:
Solution
1.) Main characteristics of Haloarchaea are as follows:
Halophiles cope up with the osmotic stress through accumulating high salt concentration within
the cytoplasm. This helps in achieving isosmotic balance with the surrounding and maintains the
cell volume. For this purpose the halophiles have some compatible solutes or osmolytes such as
glycerol, sucrose, ecotine, amino acids etc. which accumulate in them without effecting the pH
and metabolic processes. Some halobacteria accumulate potassium chloride to compensate he
outside present sodium chloride salt. The compatible solutes are obtained by biosynthesis,
storage materials or from the medium present outside.
2.) Rhodopsins are retinal binding proteins that acts as light dependent ion transport pump which
uses light energy to move protons outside the membrane. They include bacteriorhodopsin,
archaerhodopsin, halorhodopsin and sensory rhodopsin.
Functions of rhodopsins are as follows:
The importance of rhodopsins are as follows:.
1. The three bacteria that may be implicated in the given case are S.pdfinfo382133
1. The three bacteria that may be implicated in the given case are Staphylococcus aureus,
Haemophilus parainfluenzae, Cardiobacterium hominis . These organisms generally occur in the
saliva as normal flora. However, drug users who lick the blood on syringes ingest them and thus,
they can casue polymicrobial endocarditis.
2. Cardiobacterium hominis is Gram negative bacillus that occurs as normal flora of mouth and
upper respiratory tract. The bacterium is grouped into HACEK group. The organism can cause
inflammation of heart valves. It produces beta lactamases
Haemophilus parainfluenzae: Gram negative, pleomorphic, facultative anaerobes. The organism
is mostly assocaited with upper respiratory tract infections and mitral valve inflammation. The
organism is generally found in coinfection with Streptococcus.
Cardiobacterium hominis: It is a Gram negative bacillus of HACEK group. It is part of normal
flora of upper respiratory tract and mouth.
These organisms are generally harmless, and occur as secondary infection. When there is a
disturbance to the mucosal surface, they gain access and enter the tissues. They cause infections
at abnormal tissues of heart like damages valves, in particular. They initiate an inflammatory
response.
3. The organisms are normally present as flora in the host. The patient acquired these bacteria
due to the use of syringe drugs. Licking of the blood on the syringe, and sterilizing the syringe by
licking makes the organism enter the sytem.
Solution
1. The three bacteria that may be implicated in the given case are Staphylococcus aureus,
Haemophilus parainfluenzae, Cardiobacterium hominis . These organisms generally occur in the
saliva as normal flora. However, drug users who lick the blood on syringes ingest them and thus,
they can casue polymicrobial endocarditis.
2. Cardiobacterium hominis is Gram negative bacillus that occurs as normal flora of mouth and
upper respiratory tract. The bacterium is grouped into HACEK group. The organism can cause
inflammation of heart valves. It produces beta lactamases
Haemophilus parainfluenzae: Gram negative, pleomorphic, facultative anaerobes. The organism
is mostly assocaited with upper respiratory tract infections and mitral valve inflammation. The
organism is generally found in coinfection with Streptococcus.
Cardiobacterium hominis: It is a Gram negative bacillus of HACEK group. It is part of normal
flora of upper respiratory tract and mouth.
These organisms are generally harmless, and occur as secondary infection. When there is a
disturbance to the mucosal surface, they gain access and enter the tissues. They cause infections
at abnormal tissues of heart like damages valves, in particular. They initiate an inflammatory
response.
3. The organisms are normally present as flora in the host. The patient acquired these bacteria
due to the use of syringe drugs. Licking of the blood on the syringe, and sterilizing the syringe by
licking makes the organism enter the sytem..
1. Pros and Cons of IP CCTVNew threats are introduced to the secu.pdfinfo382133
1. Pros and Cons of IP CCTV:
New threats are introduced to the security world as systems migrate from traditional analogue to
IP network-enabled systems particularly in video surveillance. Internet Protocol (IP) provide an
open platform for integration at the data level of multiple security and life safety devices and
applications.
Pros:
Lower initial cost: Harnissing the IT infrastructure reduces installation costs in cabling,
associated containment and power outlets.
Wide-spread compatibility
Provides flexibility and scalability
Higher security and resilience
The tight software integraion between systems make them more intelligent and reduces security
gaps, speed up the response time.
Cons:
It revolves arond network security and hackers threat.
The risk increases if camera is accesses from the mobile or phone.
Threat to the security industry and thus security from the IT sector.
2.
3. User education about security:
It is one of the hardest security layers for administrators to implement.Some of the tips are:
4. There are many problems associated with the boimetrics like fingerprints, iris patterns, face
scan, voice recognization. Make sure that the biometric data is a sensitive data compared to
others and is encrypted in transit from the biometrics device to the directory or database housing
the authentication credentials. Some biometrics readers are on USB keys or tokens that connect
to the computer. These devices should provide encryption.
Either at rest or in transit, the key to protecting biometric data is encryption and then secure
storage in a directory service such as AD or LDAP.
5. Organizations need to take pro-active steps to define the accetable use of portable storage
devices like USB flash drives within the environment and then put the tools and technology in
place to help monitor and enforce the policy and protect the network and data from the risk
caused by USB flash drives. Many organizations have an acceptable use policy defined, which
users must agree to. The Acceptable Use Policy (AUP) essentially defines how users are allowed
to use the internet, e-mail, telephones and other cmmunications and network resources.
The Group policy is an effective tool for computer on the network and enforcing the security
policies.
Solution
1. Pros and Cons of IP CCTV:
New threats are introduced to the security world as systems migrate from traditional analogue to
IP network-enabled systems particularly in video surveillance. Internet Protocol (IP) provide an
open platform for integration at the data level of multiple security and life safety devices and
applications.
Pros:
Lower initial cost: Harnissing the IT infrastructure reduces installation costs in cabling,
associated containment and power outlets.
Wide-spread compatibility
Provides flexibility and scalability
Higher security and resilience
The tight software integraion between systems make them more intelligent and reduces security
gaps, speed up the response time.
Cons:
It revolves.
1. Activation of Vit. D involves Kidney and Liver and liver is part .pdfinfo382133
1. Activation of Vit. D involves Kidney and Liver and liver is part of Digestive system. Answer
is Digestive system
2. Calcium homeostasis and phosphate homeostasis are intimately tied to each other for two
reasons. First, calcium and phosphate are the principal components of hydroxyapatite crystals
[Ca10(PO4)6(OH)2)], which by far constitute the major portion of the mineral phase of bone.
Second, they are regulated by the same hormones, primarily parathyroid hormone (PTH) and
1,25-dihydroxyvitamin D (calcitriol) and, to a lesser extent, the hormone calcitonin. These
hormones act on three organ systems-the bone, the kidneys, and the gastrointestinal (GI) tract-to
control the levels of these two ions in plasma. Answer is Endocrine system
3. Answer is Muscular system
4. Nonspecific defenses include mechanical barriers such as skin, saliva, the lacrimal apparatus,
and mucous membranes, as well as the outward flow of urine, vaginal secretions, and blood
(from wounds). Phagocytosis, fever, inflammation, and molecular strategies. Answer is
Integumentary System
5. Answer is the Circulatory system, Renal artery perfusion pressure directly regulates sodium
excretion-a process known as pressure natriuresis-and influences the activity of various
vasoactive systems such as the renin-angiotensin-aldosterone system.
6. Erythropoietin is a glycoprotein hormone produced in the kidney that acts on erythroid
progenitor cells in the bone marrow. Answer is Skeleton system
7. When the animal is in a situation of crisis or stress blood flow to the kidneys is reduced for the
sake of other organs such as the brain, heart and skeletal muscles. The sympathetic nervous
system and a heightened level of adrenalin in the plasma cause the contraction of both the
afferant and efferant arterioles. Answer is Nervous System
Solution
1. Activation of Vit. D involves Kidney and Liver and liver is part of Digestive system. Answer
is Digestive system
2. Calcium homeostasis and phosphate homeostasis are intimately tied to each other for two
reasons. First, calcium and phosphate are the principal components of hydroxyapatite crystals
[Ca10(PO4)6(OH)2)], which by far constitute the major portion of the mineral phase of bone.
Second, they are regulated by the same hormones, primarily parathyroid hormone (PTH) and
1,25-dihydroxyvitamin D (calcitriol) and, to a lesser extent, the hormone calcitonin. These
hormones act on three organ systems-the bone, the kidneys, and the gastrointestinal (GI) tract-to
control the levels of these two ions in plasma. Answer is Endocrine system
3. Answer is Muscular system
4. Nonspecific defenses include mechanical barriers such as skin, saliva, the lacrimal apparatus,
and mucous membranes, as well as the outward flow of urine, vaginal secretions, and blood
(from wounds). Phagocytosis, fever, inflammation, and molecular strategies. Answer is
Integumentary System
5. Answer is the Circulatory system, Renal artery perfusion pressure directly regulates sodium
.
Rf = (distance the spot traveled)L there are fou.pdfinfo382133
Rf = (distance the spot traveled)/L there are four spots, so from the left to the right:
Rf = 0.15 Rf = 0.40 Rf = 0.62 Rf = 0.87
Solution
Rf = (distance the spot traveled)/L there are four spots, so from the left to the right:
Rf = 0.15 Rf = 0.40 Rf = 0.62 Rf = 0.87.
No. Since sodium chloride is an ionic compound, i.pdfinfo382133
No. Since sodium chloride is an ionic compound, it will be formula units, not
molecules. Molecules indicate equal sharing of electrons, whereas in sodium chloride it is a
complex of ions.
Solution
No. Since sodium chloride is an ionic compound, it will be formula units, not
molecules. Molecules indicate equal sharing of electrons, whereas in sodium chloride it is a
complex of ions..
Iodine test is used to see if a compound has star.pdfinfo382133
Iodine test is used to see if a compound has starch. Amylose has starch.
Solution
Iodine test is used to see if a compound has starch. Amylose has starch..
Borane-THF is flammable and highly reactive with .pdfinfo382133
Borane-THF is flammable and highly reactive with water ie why the student might
have had an explosion on his hands if you had not intervened.
Solution
Borane-THF is flammable and highly reactive with water ie why the student might
have had an explosion on his hands if you had not intervened..
Ubiquity Internet is available everywhere namely at home, at work v.pdfinfo382133
Ubiquity: Internet is available everywhere namely at home, at work via mobile phones,
computers and other devices at any time.
Customization: Technology has allowed the personalized messages to the individuals and
sometimes to the groups probabily when an order is placed or for some other purpose.
Universal Standards: Actually these are one set technology known as internet standards.
Information Density: Here technology may decrease the information cost and at the same time
quality will be raised to the higher levels.
Solution
Ubiquity: Internet is available everywhere namely at home, at work via mobile phones,
computers and other devices at any time.
Customization: Technology has allowed the personalized messages to the individuals and
sometimes to the groups probabily when an order is placed or for some other purpose.
Universal Standards: Actually these are one set technology known as internet standards.
Information Density: Here technology may decrease the information cost and at the same time
quality will be raised to the higher levels..
Water is the most used resource in our day to day life . When the wa.pdfinfo382133
Water is the most used resource in our day to day life . When the water that is used for other than
driniking purposes such as house hold activities and industries etc where water used is termed as
waste water.In waste water we have different types of physical and chemical compunds which
are both toxic and harmfull to both our health and atmosphere. So this chemicals are treated by
using various technologies and reducing the risk factor .
THere are so many waste water treatment technologies that effectively reduce emerging
pollutants and ground water contaminents
1) Activated sludge process
2) Advanced oxidation process
3) Aerated lagoon
4) Aerobic granulation etc
We can see that process are aerobic in nature and some are anerobic which means in presence of
oxygen or in absence of nitrogen.
Ground water is also contaminated due to suspended solids and chemicals present in water .
Untreated waste water from septic tank which has toxic materials forms underground storage
tanks in landfills and contaminate ground water
We use ex-situ technology and in situ technology for prevention of ground water contamination.
Solution
Water is the most used resource in our day to day life . When the water that is used for other than
driniking purposes such as house hold activities and industries etc where water used is termed as
waste water.In waste water we have different types of physical and chemical compunds which
are both toxic and harmfull to both our health and atmosphere. So this chemicals are treated by
using various technologies and reducing the risk factor .
THere are so many waste water treatment technologies that effectively reduce emerging
pollutants and ground water contaminents
1) Activated sludge process
2) Advanced oxidation process
3) Aerated lagoon
4) Aerobic granulation etc
We can see that process are aerobic in nature and some are anerobic which means in presence of
oxygen or in absence of nitrogen.
Ground water is also contaminated due to suspended solids and chemicals present in water .
Untreated waste water from septic tank which has toxic materials forms underground storage
tanks in landfills and contaminate ground water
We use ex-situ technology and in situ technology for prevention of ground water contamination..
The initiation of the sporulation of the bacteria is a complex cellu.pdfinfo382133
The initiation of the sporulation of the bacteria is a complex cellular event controlled by an
extensive network of regulatory proteins.
They serve to ensure that a cell begin on this differentiation process only when appropriate
conditions are met.
The major signal transduction pathway for the initiation of sporulation is phosphorelay ,which
responds to the environmental,cell cycle, and metabolic signals and phosphorylates the spo0A
transcription factor activating its function.
Signal input into phosphorelay occurs through activation of kinases to phosphorylate a second
messenger protein,spo0F.
Spo0F-P serves as a substrate for phosphoprotein phosphotransferase spo0B, which
phosphorylates spo0A.
The pathway is regulated by the transcriptional control of is component proteins and by
regulating phosphate flux through the pathway.
Thus two-component regulatory system control sporulation process in Bacillus subtilis.
Solution
The initiation of the sporulation of the bacteria is a complex cellular event controlled by an
extensive network of regulatory proteins.
They serve to ensure that a cell begin on this differentiation process only when appropriate
conditions are met.
The major signal transduction pathway for the initiation of sporulation is phosphorelay ,which
responds to the environmental,cell cycle, and metabolic signals and phosphorylates the spo0A
transcription factor activating its function.
Signal input into phosphorelay occurs through activation of kinases to phosphorylate a second
messenger protein,spo0F.
Spo0F-P serves as a substrate for phosphoprotein phosphotransferase spo0B, which
phosphorylates spo0A.
The pathway is regulated by the transcriptional control of is component proteins and by
regulating phosphate flux through the pathway.
Thus two-component regulatory system control sporulation process in Bacillus subtilis..
The emissivity of a given surface is the measure of its ability to e.pdfinfo382133
The emissivity of a given surface is the measure of its ability to emit radiation energy in
comparison to a blackbody at the same temperature. The emissivity of a surface varies between
zero and one. This is a property that measures how much a surface behaves as a blackbody. The
emissivity of a real surface varies as a function of the surface temperature, the wavelength, and
the direction of the emitted radiation.
Reflectivity is the amount of radiant energy reflected off a surface and it is related to surface
material.
these characteristics impact visual augmentation systems. because by detecting thermal radiation
emitted by a body position of that body can be located. similarly reflectivity effect is used in
visual glint phenomenon.
these two techniques are used in euipment used by army to detect and locate position of enemy
Solution
The emissivity of a given surface is the measure of its ability to emit radiation energy in
comparison to a blackbody at the same temperature. The emissivity of a surface varies between
zero and one. This is a property that measures how much a surface behaves as a blackbody. The
emissivity of a real surface varies as a function of the surface temperature, the wavelength, and
the direction of the emitted radiation.
Reflectivity is the amount of radiant energy reflected off a surface and it is related to surface
material.
these characteristics impact visual augmentation systems. because by detecting thermal radiation
emitted by a body position of that body can be located. similarly reflectivity effect is used in
visual glint phenomenon.
these two techniques are used in euipment used by army to detect and locate position of enemy.
ANSWER Accounting concepts and conventions In dr.pdfinfo382133
ANSWER Accounting concepts and conventions In drawing up accounting
statements, whether they are external \"financial accounts\" or internally-focused \"management
accounts\", a clear objective has to be that the accounts fairly reflect the true \"substance\" of the
business and the results of its operation. The theory of accounting has, therefore, developed the
concept of a \"true and fair view\". The true and fair view is applied in ensuring and assessing
whether accounts do indeed portray accurately the business\' activities. To support the
application of the \"true and fair view\", accounting has adopted certain concepts and
conventions which help to ensure that accounting information is presented accurately and
consistently. Accounting Conventions The most commonly encountered convention is the
\"historical cost convention\". This requires transactions to be recorded at the price ruling at the
time, and for assets to be valued at their original cost. Under the \"historical cost convention\",
therefore, no account is taken of changing prices in the economy. The other conventions you
will encounter in a set of accounts can be summarised as follows: Monetary measurement
Accountants do not account for items unless they can be quantified in monetary terms. Items that
are not accounted for (unless someone is prepared to pay something for them) include things like
workforce skill, morale, market leadership, brand recognition, quality of management etc.
Separate Entity This convention seeks to ensure that private transactions and matters relating to
the owners of a business are segregated from transactions that relate to the business. Realisation
With this convention, accounts recognise transactions (and any profits arising from them) at the
point of sale or transfer of legal ownership - rather than just when cash actually changes hands.
For example, a company that makes a sale to a customer can recognise that sale when the
transaction is legal - at the point of contract. The actual payment due from the customer may not
arise until several weeks (or months) later - if the customer has been granted some credit terms.
Materiality An important convention. As we can see from the application of accounting
standards and accounting policies, the preparation of accounts involves a high degree of
judgement. Where decisions are required about the appropriateness of a particular accounting
judgement, the \"materiality\" convention suggests that this should only be an issue if the
judgement is \"significant\" or \"material\" to a user of the accounts. The concept of
\"materiality\" is an important issue for auditors of financial accounts. Accounting Concepts
Four important accounting concepts underpin the preparation of any set of accounts: Going
Concern Accountants assume, unless there is evidence to the contrary, that a company is not
going broke. This has important implications for the valuation of assets and liabilities.
Consistency Transactions and val.
As ions are charged species a strong interactions.pdfinfo382133
As ions are charged species a strong interactions(attractions) are possible between
the oppositely charged ions. Where as london dispersion forces(vanderwaal forces) are weak
forces as they are induced dipole-dipole attractions, these are temporary and weak attractions. ex:
between Na+& Cl- strong ionic attractions are present. between 2 molecules of water london
forces involve. and hence NaCl has high mp & bp than H2O
Solution
As ions are charged species a strong interactions(attractions) are possible between
the oppositely charged ions. Where as london dispersion forces(vanderwaal forces) are weak
forces as they are induced dipole-dipole attractions, these are temporary and weak attractions. ex:
between Na+& Cl- strong ionic attractions are present. between 2 molecules of water london
forces involve. and hence NaCl has high mp & bp than H2O.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Please follow the data 1) For Line 23 In the IF - Condition yo.pdf
1. Please follow the data :
1) For Line 23 :
In the IF - Condition you are just checking the cells of the grid at positions 0 and 1. But I
suppose you would like to check if both the cells are having the character value 'x'. So to
achieve this you need to replace the code with
if(grid[0] == grid[1] == 'x')
2) For Line 29 :
The error is that the function has been define before the error line and the loop has not been
closed so pplace a closing brackets for the loop before the line starting with bool tie()
3) For Line 37 :
The above change should also resolve this as the scope of the main function isnt predefined.
4) For Line 69 :
Remove the excess bracket at the end of the code.
Even after replacing these I suppose your code would not work as the input has not been defined
from where and how thw user can get the data to the code. So to avoid this I am placing my
code.
Please follow the code and comments for descripiton :
CODE :
#include
using namespace std;
int checkWin( char[]); // rewuired variables
void grid( char[]);
int main()
{
char cell[10] = {'o','1','2','3','4','5','6','7','8','9'}; // placing the cell names
int player = 1,i,choice; // initialisations
char symbol;
do // looping to get the player choices
{
grid(cell);
if(player%2==1) { // checking for the player
player=1;
} else {
player=2;
}
2. // player 2 is the computer
if(player==2) // if is a player 2
{
cout << "Player " << player<> choice;
symbol='X';
if (choice == 1 && cell[1] == '1') {
cell[1] = symbol;
}
else if (choice == 2 && cell[2] == '2') {
cell[2] = symbol;
}
else if (choice == 3 && cell[3] == '3') {
cell[3] = symbol;
}
else if (choice == 4 && cell[4] == '4') {
cell[4] = symbol;
}
else if (choice == 5 && cell[5] == '5') {
cell[5] = symbol;
}
else if (choice == 6 && cell[6] == '6') {
cell[6] = symbol;
}
else if (choice == 7 && cell[7] == '7') {
cell[7] = symbol;
}
else if (choice == 8 && cell[8] == '8') {
cell[8] = symbol;
}
else if (choice == 9 && cell[9] == '9') {
cell[9] = symbol;
} else {
cout<<"Invalid move..!!!"<< endl;
player--;
exit(0);
3. }
i=checkWin(cell);
player++;
}
} while(i==-1);
grid(cell);
if(i==1) {
cout<<"Congratulations! Player "<<--player<<" won the Game..!!";
} else {
cout<<" OOPS..!!!! The Game has been tie..!!";
}
exit(0);
return 0;
}
void grid(char cell[]) // printing the grid everytime the user has placed the symbol
{
system("cls");
cout << " tTic Tac Toe Game ";
cout << "Player 1 (X) - Player 2 (O)" << endl << endl;
cout << endl;
cout << " | | " << endl;
cout << " " << cell[1] << " | " << cell[2] << " | " << cell[3] << endl;
cout << "_____|_____|_____" << endl;
cout << " | | " << endl;
cout << " " << cell[4] << " | " << cell[5] << " | " << cell[6] << endl;
cout << "_____|_____|_____" << endl;
cout << " | | " << endl;
cout << " " << cell[7] << " | " << cell[8] << " | " << cell[9] << endl;
cout << " | | " << endl << endl;
}
int checkWin(char cell[])// checking for the win condition
{
if (cell[1] == cell[2] && cell[2] == cell[3]) {
return 1;
}
4. else if (cell[4] == cell[5] && cell[5] == cell[6]) {
return 1;
}
else if (cell[7] == cell[8] && cell[8] == cell[9]) {
return 1;
}
else if (cell[1] == cell[4] && cell[4] == cell[7]) {
return 1;
}
else if (cell[2] == cell[5] && cell[5] == cell[8]) {
return 1;
}
else if (cell[3] == cell[6] && cell[6] == cell[9]) {
return 1;
}
else if (cell[1] == cell[5] && cell[5] == cell[9]) {
return 1;
}
else if (cell[3] == cell[5] && cell[5] == cell[7]) {
return 1;
}
else if (cell[1] != '1' && cell[2] != '2' && cell[3] != '3'
&& cell[4] != '4' && cell[5] != '5' && cell[6] != '6'
&& cell[7] != '7' && cell[8] != '8' && cell[9] != '9') {
return 0;
}
else {
return -1;
}
}
OUTPUT :
1) For a Tie Game Case :
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
5. 1 | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
7 | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol :
7
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
1 | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
6. X | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 5
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | 3
_____|_____|_____
| |
4 | X | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | O
7. _____|_____|_____
| |
4 | X | 6
_____|_____|_____
| |
X | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | O
_____|_____|_____
| |
4 | X | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 2
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
4 | X | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
8. Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
4 | X | O
_____|_____|_____
| |
X | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
4 | X | O
_____|_____|_____
| |
X | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 4
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
X | X | O
_____|_____|_____
| |
9. X | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
X | X | O
_____|_____|_____
| |
X | O | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
X | X | O
_____|_____|_____
| |
X | O | 9
| |
Player 1, Please enter the grid number to place the symbol : 9
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
10. _____|_____|_____
| |
X | X | O
_____|_____|_____
| |
X | O | X
| |
OOPS..!!!!
The Game has been tie..!!
2) For Win Case :
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
1 | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
7 | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 1
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
7 | 8 | 9
11. | |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
O | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
O | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 2
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | X | 3
_____|_____|_____
12. | |
4 | 5 | 6
_____|_____|_____
| |
O | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | X | 3
_____|_____|_____
| |
4 | O | 6
_____|_____|_____
| |
O | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | X | 3
_____|_____|_____
| |
4 | O | 6
_____|_____|_____
| |
O | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 3
Tic Tac Toe Game
13. Player 1 (X) - Player 2 (O)
| |
X | X | X
_____|_____|_____
| |
4 | O | 6
_____|_____|_____
| |
O | 8 | 9
| |
Congratulations!
Player 1 won the Game..!!
Hope this is helpful.
Solution
Please follow the data :
1) For Line 23 :
In the IF - Condition you are just checking the cells of the grid at positions 0 and 1. But I
suppose you would like to check if both the cells are having the character value 'x'. So to
achieve this you need to replace the code with
if(grid[0] == grid[1] == 'x')
2) For Line 29 :
The error is that the function has been define before the error line and the loop has not been
closed so pplace a closing brackets for the loop before the line starting with bool tie()
3) For Line 37 :
The above change should also resolve this as the scope of the main function isnt predefined.
4) For Line 69 :
Remove the excess bracket at the end of the code.
Even after replacing these I suppose your code would not work as the input has not been defined
from where and how thw user can get the data to the code. So to avoid this I am placing my
code.
Please follow the code and comments for descripiton :
CODE :
#include
14. using namespace std;
int checkWin( char[]); // rewuired variables
void grid( char[]);
int main()
{
char cell[10] = {'o','1','2','3','4','5','6','7','8','9'}; // placing the cell names
int player = 1,i,choice; // initialisations
char symbol;
do // looping to get the player choices
{
grid(cell);
if(player%2==1) { // checking for the player
player=1;
} else {
player=2;
}
// player 2 is the computer
if(player==2) // if is a player 2
{
cout << "Player " << player<> choice;
symbol='X';
if (choice == 1 && cell[1] == '1') {
cell[1] = symbol;
}
else if (choice == 2 && cell[2] == '2') {
cell[2] = symbol;
}
else if (choice == 3 && cell[3] == '3') {
cell[3] = symbol;
}
else if (choice == 4 && cell[4] == '4') {
cell[4] = symbol;
}
else if (choice == 5 && cell[5] == '5') {
cell[5] = symbol;
15. }
else if (choice == 6 && cell[6] == '6') {
cell[6] = symbol;
}
else if (choice == 7 && cell[7] == '7') {
cell[7] = symbol;
}
else if (choice == 8 && cell[8] == '8') {
cell[8] = symbol;
}
else if (choice == 9 && cell[9] == '9') {
cell[9] = symbol;
} else {
cout<<"Invalid move..!!!"<< endl;
player--;
exit(0);
}
i=checkWin(cell);
player++;
}
} while(i==-1);
grid(cell);
if(i==1) {
cout<<"Congratulations! Player "<<--player<<" won the Game..!!";
} else {
cout<<" OOPS..!!!! The Game has been tie..!!";
}
exit(0);
return 0;
}
void grid(char cell[]) // printing the grid everytime the user has placed the symbol
{
system("cls");
cout << " tTic Tac Toe Game ";
cout << "Player 1 (X) - Player 2 (O)" << endl << endl;
cout << endl;
17. }
else if (cell[1] != '1' && cell[2] != '2' && cell[3] != '3'
&& cell[4] != '4' && cell[5] != '5' && cell[6] != '6'
&& cell[7] != '7' && cell[8] != '8' && cell[9] != '9') {
return 0;
}
else {
return -1;
}
}
OUTPUT :
1) For a Tie Game Case :
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
1 | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
7 | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol :
7
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
1 | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
18. | |
X | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
X | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 5
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
19. O | 2 | 3
_____|_____|_____
| |
4 | X | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | O
_____|_____|_____
| |
4 | X | 6
_____|_____|_____
| |
X | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | 2 | O
_____|_____|_____
| |
4 | X | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 2
20. Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
4 | X | 6
_____|_____|_____
| |
X | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
4 | X | O
_____|_____|_____
| |
X | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
4 | X | O
21. _____|_____|_____
| |
X | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 4
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
X | X | O
_____|_____|_____
| |
X | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
X | X | O
_____|_____|_____
| |
X | O | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
22. | |
O | X | O
_____|_____|_____
| |
X | X | O
_____|_____|_____
| |
X | O | 9
| |
Player 1, Please enter the grid number to place the symbol : 9
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
O | X | O
_____|_____|_____
| |
X | X | O
_____|_____|_____
| |
X | O | X
| |
OOPS..!!!!
The Game has been tie..!!
2) For Win Case :
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
1 | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
23. | |
7 | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 1
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
7 | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
O | 8 | 9
| |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
24. X | 2 | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
O | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 2
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | X | 3
_____|_____|_____
| |
4 | 5 | 6
_____|_____|_____
| |
O | 8 | 9
| |
Player 2
Press Enter for the Computer Turn..!!
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | X | 3
_____|_____|_____
| |
4 | O | 6
_____|_____|_____
| |
O | 8 | 9
25. | |
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | X | 3
_____|_____|_____
| |
4 | O | 6
_____|_____|_____
| |
O | 8 | 9
| |
Player 1, Please enter the grid number to place the symbol : 3
Tic Tac Toe Game
Player 1 (X) - Player 2 (O)
| |
X | X | X
_____|_____|_____
| |
4 | O | 6
_____|_____|_____
| |
O | 8 | 9
| |
Congratulations!
Player 1 won the Game..!!
Hope this is helpful.