Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/* PF2 lab4 In this lab, you will practice working with one dimensional arrays. Design and implement a BigInteger class that can add, subtract and

/* PF2 lab4 In this lab, you will practice working with one dimensional arrays. Design and implement a BigInteger class that can add, subtract and multiply integers up to 25 digits. To help you get started, I have provided you with methods to input and output the numbers. You merely have to implement the add, subtract and multiply methods. SIMPLIFYING ASSUMPTION: Don't worry about negative numbers. When subtracting numbers, the difference will always be positive. But your program should be able to subtract, for instance, 5 from 1001. (has to handle "borrowing") Put your lab in ~/PF2/lab4/Lab4.java */ import java.io.*; class BigInteger { private final int INTSIZ=25; private int intArray[] = new int[INTSIZ]; // As it turns out, my BigInteger constructor didn't do anything, // so I just commented it out and will let the system provide a // "default" contstructor. If you find that you want/need to write // a constructor, that is fine. // public BigInteger() // { // } public void printBigInteger() { for (int i=0; i INTSIZ) throw new ArithmeticException("OVERFLOW!"); for (int i=0; i                        

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

Recommended Textbook for

More Books

Students also viewed these Databases questions