Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

2. Enrolling employees in courses and programs.

Answered: 1 week ago

Question

1. Communicating courses and programs to employees.

Answered: 1 week ago

Question

6. Testing equipment that will be used in instruction.

Answered: 1 week ago