Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Iverson modification of Chapter 7, Programming Project #1, page 527 Additional explanations from the text authors: SumBigInts.pdf Settings SUBMIT SumBigInts.java Warning: I've assigned this in

Iverson modification of Chapter 7, Programming Project #1, page 527

Additional explanations from the text authors: SumBigInts.pdf

Settings

SUBMIT SumBigInts.java

Warning: I've assigned this in past quarters, and other faculty have too over the years, lots of resources out there, but you must WRITE YOUR OWN CODE. Look at all the example you please, then write your own code. In addition, I change to the following specifications that will be strictly enforced:

1. Submit SumBigInts.java with a main method plus at least three other methods that help you solve this assignment in a well structured form.

2. Define "interactive" in the text as interacting with input from a File as used in test code below. So the provided main() below MUST work.

3. Use MAX_DIGITS to determine the length of int[ ] arrays. I will change this upon testing. Maybe just start with code provided below:

4. Don't forget // comments, indents, etc: Program Submission Requirements

// This program reads an input file that contains sequences of integers to // be added together. The program reads them as Strings so that it can // process large integers. Reset the constant DIGITS to allow it to handle // larger integers. import java.io.*; import java.util.*; public class SumBigInts { public static final int MAX_DIGITS = 25; public static void main(String[] args) throws FileNotFoundException { Scanner input = new Scanner(new File("sum.txt")); processFile(input); } ... // more methods follow for i/o and add and ..... } 

And here's the test text file to read (I'll change this for grading) plus the expected output to System.out

sum.txtimage text in transcribed

image text in transcribed

Suggestions:

Feel free to look at the code from Oracle on how they do BigInteger, and for hints on how to proceed:

http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/math/BigInteger.java#1054 (Links to an external site.)Links to an external site.

But remember:

DO NOT import BigInteger nor BigDecimal for your final answer, and

DO NOT use System.in for console input, just read a File, and

DO use online resources wisely, then close that window and write you own code.

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

4. What action should Cherita Howard take and why?

Answered: 1 week ago