Question

need help, please!!!!! (netbeans) by JAVA Q: write a hole program started from the package In...

need help, please!!!!! (netbeans) by JAVA

Q: write a hole program started from the package In chess, the knight moves in a very special way:

either: two squares forward and one to the side or :

one square forward and two to the side Write a program to print the Probability of the moves and the main for the program

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code to copy:

   public class Chess_Board
   {
       public static String[][] board = new String[8][8];
       public static int row = 0;
       public static int column = 0;

       public static void add_Piece(int x, int y, String r){

           board[x][y] = new String(r);
       }

       public static void show_Board(){
           for (row = 0; row < board.length; row++)
           {
               System.out.println("");
               System.out.println("----");

               for(column = 0; column < board[row].length; column++)
               {
                   System.out.print("| ");

               }
           }
           System.out.println("");
           System.out.println("--");
       }

       public static void main(String[] args)
       {
           System.out.println(board.length);
           show_Board();
           add_Piece(1,2,"R");
       }
   }

Code screenshot:

Output:

Add a comment
Know the answer?
Add Answer to:
need help, please!!!!! (netbeans) by JAVA Q: write a hole program started from the package In...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In JAVA: For this question, you need to create two interface programs in a package and...

    In JAVA: For this question, you need to create two interface programs in a package and import them to the class where you implement the methods. You can create a new package in your assignment4 project (or package) to contain the two interface programs. One of the interface program has two methods ( countOne(), countTwo() ) and the other interface program has only one method (countThree ( ) ). In a separate package, write a class to implement the two...

  • I need help with the following. I need to write a program code in Java using...

    I need help with the following. I need to write a program code in Java using NetBeans. It is from How to Program Java book Chapter 2. This program should calculate the packing of Candles. First read: The number of candles The number of candles that fit in each case Then calculate and print: The number of full cases The number of candles left over (partial case) If this order is large (more than 5 full cases needed) An extra...

  • .Need code for my java class !! Write a simple java program that uses loops. You...

    .Need code for my java class !! Write a simple java program that uses loops. You may use ‘WHILE’ or ‘FOR’ or ‘DO-WHILE’ – you decide. The program should use a loop to compute the semester average for up to 5 students. In the loop the user will ask for a student name and their 3 test scores and add them up and divide the total by 3 giving the semester average. You will print out the student name and...

  • solve it with Java please Write a Java program that prompts the user to input length...

    solve it with Java please Write a Java program that prompts the user to input length and width of a shape. If length is equal to width, call a method to calculate the area of the shape and send only one side as parameter to this method. This meth return the area of the shape. If length is not equal to width, call a method to calculate the area of the shape and send both width and length as parameters...

  • Concepts: multi-dimension array and the Knight's Tour Problem A chess board consists of an 8 x 8 "array" of squares: int board[ROW][COL]={0}; A knight may move perpendicular to the edges o...

    Concepts: multi-dimension array and the Knight's Tour Problem A chess board consists of an 8 x 8 "array" of squares: int board[ROW][COL]={0}; A knight may move perpendicular to the edges of the board, two squares in any of the 4 directions, then one square at right angles to the two-square move. The following lists all 8 possible moves a knight could make from board [3][3]: board[5][4] or board[5][2] or board[4][5] or board[4][1] or board[1][4] or board[1][2] or board[2][5] or board[2][1]...

  • Battle Ship Game Write a Java program from scratch. Simple geometrical reasoning is at the core...

    Battle Ship Game Write a Java program from scratch. Simple geometrical reasoning is at the core of Battleships. One important notion is adjacency, with two sub-types: edge adjacency and corner adjacency. For example, the square (4,3) is edge-adjacent to the square (3,3), it is corner-adjacent to the square (3,2), and it is not adjacent to the square (6,7). Write a program that reads a square from the user, and prints out three lists(each with a seperate method): 1) a list...

  • I need help with my programming assignment. The language used should be java and the algorithm...

    I need help with my programming assignment. The language used should be java and the algorithm should use search trees so that you play against the computer and he chooses the best move. The tree should have all possibilities on the leaves and you could use recursion to so that it populates itself. The game can be a 3*3 board (no need the make it n*n). Please put comments so that I can understand it. Thanks The game of ‘Walls’...

  • PLEASE HELP!!!I need help with the following JAVA PROGRAMS. Please ready carefully. So this comes from...

    PLEASE HELP!!!I need help with the following JAVA PROGRAMS. Please ready carefully. So this comes from tony gaddis starting out with java book. I have included the screenshot of the problems for reference. I need HELP implementing these two problems TOGETHER. There should be TWO class files. One which has TWO methods (one to implement problem 8, and one to implement problem 9). The second class should consist of the MAIN program with the MAIN method which calls those methods....

  • Write a complete JAVA program to do the following program. The main program calls a method...

    Write a complete JAVA program to do the following program. The main program calls a method to read in (from an input file) a set of people's three-digit ID numbers and their donations to a charity (hint: use parallel arrays)Then the main program calls a method to sort the ID numbers into numerical order, being sure to carry along the corresponding donations. The main program then calls a method to print the sorted 1ists in tabular form, giving both ID...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT