Question: I was asked to implement an ADT that will replicate some of the capabilities of Javas BigInteger class. Belove is what I achieved so far,

I was asked to implement an ADT that will replicate some of the capabilities of Javas BigInteger class. Belove is what I achieved so far, and i have no idea have to write the add() method, as well as the rest.

import java.math.BigInteger;

import java.util.ArrayList;

// Your class should behave as Java's BigInteger class does. The majority of

// the methods can be studied using Java's documentation.

public class MyBigInt {

private int bigInt;

long value;

String str;

public MyBigInt (){

}

public MyBigInt(long value){

this.value = value;

}

public MyBigInt(String str){

bigInt = Integer.parseInt(str);

}

public String toString() {

return String.format("%s;%s", value, str);

}

public MyBigInt add(MyBigInt other){

}

public MyBigInt subtract(MyBigInt other){

}

public MyBigInt negate(){

}

public int compareTo(MyBigInt other)

public MyBigInt max(MyBigInt other)

public MyBigInt min(MyBigInt other)

public int signum(){

}

public static MyBigInt valueOf(long value){

return new MyBigInt(value);

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!