This is the current/final form of the hw3+4 due on the 26th July. 1. Create a class VeryLargeInteger which contains the following methods: public class VeryLargeInteger { // ------------- appropriate data fields ---------------------- // a nice approach is to manipulate Strings since it has no // obvious length limit, but working via int arrays is OK too. // ------------- constructors --------------------------------- public VeryLargeInteger(String value); public VeryLargeInteger(); // constructor initialising to zero // ------------- instance methods ----------------------------- public VeryLargeInteger addTo(VeryLargeInteger b); public VeryLargeInteger subtract(VeryLargeInteger b); public VeryLargeInteger multiplyBy(VeryLargeInteger b); public VeryLargeInteger divideBy(VeryLargeInteger b); public boolean equals(VeryLargeInteger b); public boolean isGreaterThan(VeryLargeInteger b); public boolean isNotZero(); public void displayNumber(); } Write an interactive program which uses this class to allow the user to add, multiply, etc., VeryLargeIntegers from the keyboard. Also, using this class to compute the value of y = 2^(4000), give the total distribution of the digits 0--9 in the value of y (ie how many 0's, 1's, 2's, ... , 9's there are in the answer). 2. EITHER (a) build a functioning polynomial class as an inherited class from the VeryLargeInteger class, OR (b) Think about polynomials (notice that polynomials deal in sums of powers of 'x' and big integers deal in sums of powers of '10'), and suppose you had to build a substantial algebra package to handle arithmetic with regular ints, doubles, VeryLargeIntegers, VLmodInts (ie "very large modular integers", for example, like doing 'clock face' arithmetic mod(12) so that 9+7=4, so this class would allow the selection of the positive integer to be used as the 'mod'), and VeryLargeRationals. The package would be expected to have classes to add, subtract, multiply and divide each of these types of number (always delivering an answer in the same type as that of the two numbers given). There would also be an abstract class to deal with polynomial arithmetic (adding, subtracting, multiplying and dividing polynomials). Finally, there would be a collection of explicit polynomial classes to handle each of the above 5 kinds of numbers being used as coefficients for actual polynomials; these classes being able to perform the four operations on polynomials (yielding an answer polynomial with the same type of coefficient as that of the two given polynomials), as well as being able to evaluate a given polynomial at a given value of 'x' (where the number type of 'x' is the same as the number type of the coefficients of the given polynomial). What you are asked to do for this question is NOT to write out all this code!! You are given a fairly free rein in how you organise this package, but are asked to draw up a diagram showing all the classes you propose together with any inheritance relationships and usage 'arrows'. You must then list the declarations of all the methods and data fields in these classes together with comments explaining broadly how your methods would be implemented (so writing essentially a prescription for how to proceed). You are NOT being asked to write out any of the detailed methods. 3. (This is a silly simulation of a queuing system.) Your program will have 5 input files and one output file (it will also output some information to the screen). The 5 input files (file1, ..., file5) will comprise space or line separated words beginning with A, ..., E (the first 5 letters of the alphabet) respectively. Your program will take a (shortish -- between 0.5 and 1.5 seconds) random amount of time between reading successive words from (each time) a randomly selected file. These words should be passed into a queue. Your program will output one word to the output file (space or line separated) every 1 second, and print to the screen the number of words then waiting in the queue (also any warning messages which might be appropriate). Maintain a record of the actual length of the queue each second (just after output of each word). After outputting 100 words the program will stop and write to the file on a new line the space separated values of this record of queue length. You may choose whether to implement this by allowing repeated use of any given word in a file (perhaps by reading the contents of the file into an array, queue, or other storage device), or by instead deciding to take words from the file so that the file is possibly eventually depleted (in which case you should have a way to handle the case where you find yourself trying to access a word from a now empty file). 4. Write a GUI-based calculator to perform the four standard VeryLargeInteger computations. You should also provide an effective "clear" button. (Whilst I will not ask you to do this, you should write it in such a way that it would be easy to adjust your program so that it could work with any of the 5 number types mentioned in question 2.) 5. Write a GUI-based grapher to draw graphs of functions readily found in java.math.* (so, for example, you might have buttons for sin, cos and tan, as well as the 10 digit buttons and 'x' and 'y' buttons, so that clicking 'y' then '=' then 'sin' then '2' then 'x' would draw the graph of y = sin(2x); buttons for '(' and ')' would obviously also be useful).