Adding and Subtracting positive or negative two numbers of any length with strings

Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Adding and Subtracting positive or negative two numbers of any length with strings

You are to design a Java application to carry out additions and subtractions for numbers of any length. A number is represented as an object which includes a sign and two strings for the whole and decimal parts of the number. And, the operations must be done by adding or subtracting characters directly. You are not allowed to convert these strings to numbers before the operation.
The program must use a "Number" class which includes at least the following methods:

Number ( );

Number (double n);

Number add (Number RHS);

Number subtract (Number RHS);

String toString ( );

This is what i have but it only adds positive numbers and it doesn't subtract problems like 7.05-8.96. Also some of it was what our teacher gave us like alignwhole method

Re: Adding and Subtracting positive or negative two numbers of any length with strings

how to write the code to ...

That's not a specific question. Can you break it down into something more specific.
Take one of the problems: how to add two numbers.
What are the steps the code must do for that?
At what step are you having problems?

Re: Adding and Subtracting positive or negative two numbers of any length with strings

Originally Posted by Norm

That's not a specific question. Can you break it down into something more specific.
Take one of the problems: how to add two numbers.
What are the steps the code must do for that?
At what step are you having problems?