Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7405803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:27:35+00:00 2026-05-29T05:27:35+00:00

I am looking for a clear explanation to my question (NOT looking for code),

  • 0

I am looking for a clear explanation to my question (NOT looking for code), but if a bit of code helps to explain yourself, then please do.. thank you 🙂

Question:

-using Java
-Main class asks user for 2 integer inputs, then places them into 2 arraylists, of type integer. Each digit is broken up and stored in its own index, so it is its own “element”, so to speak.

For example, with my code right now, it goes something like this:

“Please enter an integer:”

688

“Please enter another integer:”

349


At this point now, internally, I have stored the input as 2 arraylists, that look like this:

ArrayList1: [6, 8, 8]

ArrayList2: [3, 4, 9]

Now, lets say I want to perform some addition, such as ArrayList1 + ArrayList2.

I’ll probably go ahead and create a temporary ‘result’ arraylist, then move that answer over to arraylist1 when my calculation is complete.

But the part I am having trouble with, is coming up with a systematic clear way to add the arraylists together. Keep in mind that this example uses an arraylist which represents an integer of length 3, but this could be anything. I could, for example, have an arraylist with 50 elements, such as [2, 4, 4, 3, 7, 3, 6, 3,………….] which could represent a huge number in the trillions, etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:27:36+00:00Added an answer on May 29, 2026 at 5:27 am

    Think about how you would do grade-school addition. You’d start up by lining up the numbers like this:

        1  3  7
    +      4  5
    -----------
    

    Then, you’d add the last two digits to get

        1  3  7
    +      4  5
    -----------
              2
    

    And you’d have a carry of 1. You then add the next two digits, plus the carry:

        1  3  7
    +      4  5
    -----------
           8  2
    

    Now you have carry 0, so you can add the last digit and the missing digit to get

        1  3  7
    +      4  5
    -----------
        1  8  2
    

    The general pattern looks like this: starting from the last digit of each array, add the last two numbers together to get a sum and a carry. Write the units digit of the sum into the resulting array, then propagate the carry to the next column. Then add the values in that column (plus the carry) together, and repeat this process across the digits. Once you have exhausted all of the digits in one of the numbers, continue doing the sum, but pretend that there’s a 0 as the missing digit. Once you have processed all the digits, you will have the answer you’re looking for.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for a clear explanation to my question (NOT looking for code),
I am looking for a clear explanation to my question (NOT looking for code),
I've been looking on the Internet for a fairly clear explanation of the different
May be my title is not clear. I am looking for some kind of
I am using VS 2008. Looking around on the forums/stack hasn't provided a clear
I am looking to find a clear explanation of what the "this" keyword does,
UPDATE : My original question wasn't quite clear. I'm looking for the name of
I am looking for a clear explanation of what the MERGE statement in Oracle
I've been looking around for some time and couldn't find a clear explanation for
I'm looking for a clear, concise and accurate answer. Ideally as the actual answer,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.