Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners help to write a program for biology to know if two person are related or not

Have Programming Question? Ask it here!
 
 
 


shereen
help to write a program for biology to know if two person are related or not
1 Answer(s)      3 years and 4 months ago
Posted in : Java Beginners


I wrote the program and i want some help pleas this program check between if they are related or not . i have no problem of reading file and inserted in 2d array but i have wrote program to sum the ones each rows and compared to the second matrix and so that about coulmns , note : two matrix are not equal ! ,, so i will compared the small one with the bigger one so that i use start point and end point , i need only help to write the two method which sum rows and coulmns,

4

**0 0 0 0

1 1 1 1

1 1 0 0

1 1 1 1**

6

0 1 1 1 1 0

0 0 0 0 0 0

1 1 1 1 1 0

1 1 1 0 0 0

1 1 1 1 1 1

1 1 1 1 1 1

my work is

public static void main(String[] args)
{

    try
    {
        Scanner sc = new Scanner(new File("zoo"));
        int caseOne = sc.nextInt();
        int count=0 ;
        while(caseOne>=count)
        {
            //read the first matrix size.
            int length1=sc.nextInt();
            int sum=0;
            System.out.println(length1);
            int[][] m1 = new int[length1][length1];
            // print array in rectangular form
            for (int r=0; r<m1.length; r++)
            {
                for (int c=0; c<m1[r].length; c++)
                {
                    m1[r][c]=sc.nextInt();
                    System.out.print(" " + m1[r][c]);
                }
                System.out.println("");
            }
    // case two
          int length2=sc.nextInt();
            System.out.println(length2);
            int[][] m2 = new int[length2][length2];
            // print array in rectangular form
            for (int r=0; r<m2.length; r++)
            {
                for (int c=0; c<m2[r].length; c++)
                {

                    m2[r][c]=sc.nextInt();
                    {
                    System.out.print(" " + m2[r][c]);
                    }


                }
             for (int a=0; a<m2.length; a++)
            {
                for (int c=0; c<m2[a].length; c++)
                {
                    int startPoint= m2[r][c]-m1[r][c]/2;
                    System.out.print(" " + startPoint);
                    int EndPoint= m2[r][c]-startPoint;
                    System.out.print(" " + EndPoint);
                }
                System.out.println("");

            }

    count++;
        }

    }
    }
    catch (Exception e)
    {
            System.out.println(e);
    }
}


            public static int sumRow( int[][] m1,int startPoint,int ei, int A[])
            {

                return A[i];
            }
            public static int sumcol(int m2[][],int si,int ei, int B[])
            {
                int i=0 ;
                return B[i];

            }

}


Advertisement
View Answers

March 18, 2011 at 3:21 PM


sorry for my weak english



Related Tutorials/Questions & Answers:
help to write a program for biology to know if two person are related or not
help to write a program for biology to know if two person are related or not   I wrote the program and i want some help pleas this program check... point and end point , i need only help to write the two method which sum rows
Help me to write this simple java frame program
Help me to write this simple java frame program   I want to write a Java program for.... To create a frame with 4 text fields;name,street,city and pin;with suitable labels. Also add a button "OK". After enter values
Advertisements
write a program which asks the user for two int values and calculates their sum.
write a program which asks the user for two int values and calculates their sum.  The title says it all, an example is (1,2) > 3
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Write a C language program to read two matrices and multiply them?
Write a C language program to read two matrices and multiply them?  Write a C language program to read two matrices and multiply them?   Here is an example of multiplying two matrices using C language. #include <
Write a program to list all even numbers between two numbers
Write a program to list all even numbers between two numbers... Numbers Example in Java: Here you will learn to write a program for listing out all the even numbers between two numbers. For this first create a class named
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
really need help on how to write this program plz some 1 help out. - Java Beginners
really need help on how to write this program plz some 1 help out.  i am confused here on what to write can some 1 help out here i dont quite understand how to code it so can some 1 help out. Part II Write, compile and execute
write a program
write a program  write a program add 2 no.s without use arithmetic,unary operaters in java
help in java program
help in java program  please could you help me with my assignment I have to submit it on Monday 29 October please help me :( Write a program to test the Person class defined below. Your test program should
jsp program related
jsp program related  how to run jsp program   How to run jsp program: Follow these steps: 1)Go to the Control Panel>>System>>... url: http://localhost:8080/examples/hello.jsp and press enter. 9)You jsp program
Help with this program
Help with this program  Write a program that would do the following: 1) Read two Strings from the user 2) The user should input two integer numbers... the .intValue() method. 4) Add the two integers. 5) Output the result Do the same fir when
Write a program in java...
Write a program in java...  Hi, friends Please, can you help me? Q1: Write a program in java to simulate a calculator. Your program should take two... to enter an integer number. Write a program in java to find the factorial
Help with this program
Help with this program  Write a program that would do the following: 1) Read a String from the user. The String will be the following: "My grade is x" (where x is an integer between 0-9) 2) Get the String to integer by creating
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.
PLEASE Help me write a Java program which will store, manipulate, and print student registration information.  HERES TEH QUESTION - I AM MISSING SOME..., ADDRESS AND ADMISSIONS CLASS PLEASE HELP!!! Write a Java program which
help to write java code
help to write java code  write a full code to produce a system will calculate all items to get total carry-marks which are 60 marks. and get sum of assignment 1,assignment 2, midterms-test and lave work to get total marks
help to write java code
help to write java code  write a full code to produce a system will calculate all items to get total carry-marks which are 60 marks. and get sum of assignment 1,assignment 2, midterms-test and lave work to get total marks
How to implement a superclass Person? - Java Beginners
Person. Make two classes, Student and Lecturer, that inherit from Person. A person has a name and year of birth. A student has a degree program and a lecturer..., write a program name TestQ2 that instantiates an object of each
write a java program
write a java program  write a program to print '*' in a circular form
How to implement this superclass Person - Java Beginners
a superclass Person which it need to Make two classes, Student and Instructor, that inherit...,birthYear=1969],salary=65000.0]''); } } i don't know how to write a coding based on two parameters at the constructor...help me please..  Hi Friend
how to write this program
or numerical grade. You will be submitting TWO versions of this program. Write one...how to write this program  Write a program in java which calculates...?Ęs GPA. This program should take a student√Ę‚?¨‚?Ęs First Name, Last Name a GPA
How to write Java Program
How to write Java Program  how to write a program to find average of 5 student marks
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  Write program which accepts five students id,name,age,department,courses, taken and its grade. a. calculate its GPA . display all student information in ascending order
write the java program?
write the java program?  1 11 121 1331 14641 15101051
Write java program?
Write java program?  1 11 121 1331 14641 15101051
Write java program?
Write java program?  1 11 121 1331 14641 15101051
write the java program?
write the java program?  1 11 121 1331 14641 15101051
write a program to print
write a program to print   write a program to print following 1 2 3 4 5 4 3 2 1 1 2 3 4 4 3 2 1 1 2 3 3 2 1 1 2 2 1 1 1
Write a java application program........?
Write a java application program........?  Welcome every One : I have Q in Java? Q : Write a java application program that reads 20 integer numbers input by the user and prints how many numbers > 100 and how many numbers
Two Dimensional array program
Two Dimensional array program  consider a two dimensional array of size mn where both mn are greater than 20.derive a function that can be used... and the first become the last.let the program output elements of the first array
write a program - Java Beginners
write a program  1. write a program that reads a string composed of 6 words then generate and print a word composed of the first letters of the 6 words.  Hi friend, Code to solve the problem : class FirstLetter
WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  How do I write a program in Java, have the program display a message with your name in it and a number (Hello john Smith!1) The number must increment from zero to nine, or decrement fron nine to zero. You
need help with program
need help with program  To write a program where we can take two integer array as input,Find the missing number from array"B" has all the numbers from array"A" except one,and find the fastest way in doing
Write a java pregram: Help with methods
Write a java pregram: Help with methods  Write a Java method that returns the number of days in a year using the following header: public static int numberOfDaysInAYear (int year) Write a Java program that uses your method
compile this program and let me know the resolution
compile this program and let me know the resolution  class Maxof2...+" is greater than "+i); } } please compile and let me know the resolution   Hello Friend, After compiling the code, while running the code, specify two
write program - Java Beginners
write program  write a java program that will read the values of matrix A and B give its multiplication in matrix C  Hi friend, Code for Matrix Multiplication : class MatrixMultiplication{ public static void
PHP related - how to explot a string with commas and store into two different variables?
PHP related - how to explot a string with commas and store into two different variables?  Hi, I have a string and is like this '[tubelist 123456,54321,56789,98765]'. I would like to extract the first value after the tubelist
write a program in java.
write a program in java.  arrange the natural n umber in 5x5 matrix as 21 22 23 24 25 20 7 8 9 10 19 6 1 2 11 18 5 4 3 12 17 16 15 14 13 i at centerd position and remaining arrange in anticlockwise direction.  
write following program
write following program  Q1 What is the difference between single...-threading. Explain with examples Q2 Write a java applet that takes your name through a parameter from the HTML file and displays it Q3 Write a short note
Person have name field of Name type..??
, middlename, and lastname but i dont know how to use this class in person to give him name? can you please write code two two different class and show me how to use...Person have name field of Name type..??  Person have name field
how to write servlet program in eclipse?
how to write servlet program in eclipse?  how to write servlet program in eclipse
How to write calculator in J2ME program?
How to write calculator in J2ME program?  How to write calculator in J2ME program
Write a program to print using for loop
Write a program to print using for loop  Write a program to print using for loop * * * *  
need help with program
need help with program  To write a program to read a set of words from a file and return the following 1)Each word in the file against its frequency 2) the frequency should be in the descending order of the frequencies
to write a program to display the employee details..
to write a program to display the employee details..  To dipslay... running this program the new window has to be opened asking us to enter all...   not this one actually i wnat a very small program that displays all
multithreaded program help!!!!
multithreaded program help!!!!  Write a multithreaded program that calculates various statistical values for a list of numbers. This program... value. For example, suppose your program is passed the integers 90 81 78 95 79
Two Dimensional Array Program
Two Dimensional Array Program Using Nested for loop...; program . In this session we will teach how to use of a two dimensional array. First of all we will define a class "Matrix". In this program we
How to Write a Calculator Program in Java?
How to Write a Calculator Program in Java? In this Java Tutorial you will learn how to write a Calculator program in Java in easy steps. Calculator program..., subtraction, multiplication or division. In this example of writing program in Java
 

 

 

DMCA.com