Question
I need two methods that add and subtract two very large numbers in java created in a class called number and it runs on the
I need two methods that add and subtract two very large numbers in java created in a class called number and it runs on the demo below class below.
Please don't use parseInt or BigIntger, they are not allowed.
Thank you so much
public class demoClass {
public static void main(String[] args) {
number num1; //number is class that we need to create to the add and subtract methods
num1 = new number("11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111");
number num2; //number is class that we need to create to the add and subtract methods
num2 = new number("22222222222222222222222222222222222222222222222222222222222222222222222222222222");
sum = num1.add(num2);
minus = num1.subtract(num2);
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started