Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Ive posted this a couple times and the min and max methods, and the working calc

ID: 3744930 • Letter: I

Question

Ive posted this a couple times and the min and max methods, and the working calculator are missing.

I am missing the min and max methods and cant get the calculator to output the way they have it.

Java provides a class java.lang.BigInteger that can be used to handle very large integers. Implement a similar class, called BigInt, that can be used to do simple calculations with very large nonnegative numbers. Design thhis class carefully. You will need the following:"

- A data structure to represent large numbers: an ArrayList for the digits in a number.

- public BigInt( ArrayList val):

A constructor that uses a string representation of the integer for initialization. The string may contain leading zeros. Do not forget that zero is a valid number .

- public String toString():

Returns the String representation of this BigInt. It should not include leading zeros, but if the number consists of all zeros, it should return a String with a single zero.

- public BigInt max(BigInt val): NEED TO HAVE THIS

A method that returns a BigInt whose value is the maximum of val and the instance of BigInt that invokes max

. - public BigInt min(BigInt val): NEED TO HAVE THIS

A method that returns a BigInt whose value is the minimum of val and the instance of BigInt that invokes min.

- public BigInt add(BigInt val):

A method that returns a BigInt whose value is the sum of val and the instance of BigInt that invokes add.

- public BigInt multiply(BigInt val):

A method that returns a BigInt whose value is the product of val and the instance of Bigint that invokes multiply.

NEED THIS

Write a program that acts as an interactive calculator capable of handling very large nonnegative integers that uses the BigInt class. This calculator need perform only the operations of addition and multiplication. In this program each input line is of the form num1 op num2 and should produce output such as

num1

op num2

----------------

num3

where num1 and num2 are (possibly very large) nonnegative numbers, op is the single character + or *, and num3 is the integer that results from the desired calculation. Be sure your interface is user friendly

Explanation / Answer

#include #include // for strings #include // for sequence of digits using namespace std; class BigInt { public: BigInt(); // default constructor, value = 0 BigInt(int); // assign an integer value BigInt(const string &); // assign a string // may need these in alternative implementation // BigInt(const BigInt &); // copy constructor // ~BigInt(); // destructor // const BigInt & operator = (const BigInt &); // assignment operator // operators: arithmetic, relational const BigInt & operator += (const BigInt &); const BigInt & operator -= (const BigInt &); const BigInt & operator *= (const BigInt &); const BigInt & operator *= (int num); string ToString() const; // convert to string int ToInt() const; // convert to int double ToDouble() const; // convert to double // facilitate operators ==,
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote