Results 1 to 7 of 7
  1. #1
    blutao is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default I am new to Java

    Took a 5 week crash course in summer, now I have this project due by Tuesday, and stuck. In great need. PL help me as I am lost. I got some help from others but not enough. the project is to implement a ADT using doubly link list to add, subtract, multiply, divide and square 2 big numbers. I have the add and subtract working, but need multiply and divide. PL let me know if I can be helped. Here is the code that is working for add and subtract. Need mult and divide methods.

    Java Code:
    public class Run {
    	public static void main(String[] args) {
    		LongInt l1 = new LongInt();
    		(integer.substring(currStart, currEnd));
    			Node insert = new Node(getDigits, null, curr);
    			insertRight(curr, insert);
    			curr = insert;
    			currStart += 4;
    			currEnd += 4;
    		}
    		tail = curr;
    	}
    	
    	
    	
    	
    	
    }
    Last edited by blutao; 11-06-2010 at 03:27 PM. Reason: Moderator Edit: Code tags added

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    So where is your attempt at multiply and divide that we can help you correct?

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,036
    Rep Power
    20

    Default

    "I am new to Java"

    Then why post this in the Advanced Java section??

  4. #4
    blutao is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by masijade View Post
    So where is your attempt at multiply and divide that we can help you correct?
    Java Code:
    public LongInt multiply(LongInt other) {
    		Node r1, r2;
    		//Node resetPos;  // Each time you finish, one multiplication, go back to here + 1 node.
    		LongInt c = new LongInt();
    		LongInt d = new LongInt();
    		
    		r1 = this.firstRight();
    		r2 = other.firstRight();
    		//resetPos = other.firstLeft();
    		int carry = 0;
    		int result;
    		
    		// Multiply the right node of the second number by the entire first number
    		
    			c.sign = '+';
    		return c;
    Last edited by blutao; 11-06-2010 at 03:27 PM.

  5. #5
    blutao is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    well. I thought the topic is advanced, so assuming that needs advanced attention!

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I've added code tags to your first post and will let you add them to your latest post. To see how to do this, please read the forum FAQ or the link in my signature.

  7. #7
    blutao is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    and I did not attempt to do any divide. quite honestly, this level of code and programming is advanced. My level is not near, I am just learning. Is it possible to get help for divide? Not sure where to start and divide is supposed to be very difficult.
    Last edited by blutao; 11-06-2010 at 12:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •