Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hey i need a help with this question Write a structured program that can accept two integer numbers up to 40 digits and perform the

hey i need a help with this question

Write a structured program that can accept two integer numbers up to 40 digits and perform the followings:

1. Add the two numbers and display the result.

2. The result number should be separated by commas. For example

If inputs are:

Number1: 236598745632

Number2: 2453254365546764765

The output should be:

236,598,745,632 +

2,453,254,365,546,764,765

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

2,453,254,602,145,510,397

i just want to do it in basic java

Notes:

You must read the two input numbers as string objects, then verify if the input is correct (i.e. all digit characters).

You may assume that your program only works for positive integer numbers.

You cannot use any of BigDecimal / BigInteger / double / long / int types for your calculations.

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

Students also viewed these Databases questions