Question: Java Project 1. The largest positive integer of type int is 2,147,483,647. Another integer type, long, represents integers up to 9,223,372,036,854,775,807. Imagine that you want

Java ProjectJava Project 1. The largest positive integer of type int is 2,147,483,647.

1. The largest positive integer of type int is 2,147,483,647. Another integer type, long, represents integers up to 9,223,372,036,854,775,807. Imagine that you want to represent even larger integers. For example, cryptography uses integers having more than 100 digits. Design and implement a class Huge of very large nonnegative integers. The largest integer should contain at least 30 digits. Use a deque to represent the value of an integer. Provide operations for the class that * Set the value of a nonnegative integer (provide both set methods and constructors) Return the value of a nonnegative integer as a string Read a large nonnegative integer (skip leading zeros, but remember that zero is a valid number) Display a large nonnegative integer (do not display leading zeros, but if the integer is zero, display a single zero) . Add two nonnegative integers to produce the sum as a third integer . Multiply two nonnegative integers to produce the product as a third integer You should handle overflow when reading, adding, or multiplying integers. An integer is too large if it exceeds MAX_SIZE digits where MAX_SIZE is a named constant that you define. Write a test program that demonstrates each method

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!