Question: Create an arithmetic program that stores integers in linked list nodes. Each node will store a three digit integer, Subsequent nodes will hold parts of
Create an arithmetic program that stores integers in linked list nodes. Each node will store a three digit integer, Subsequent nodes will hold parts of numbers that are greater than four digits long.
For example: 2,101,453,788 would be represented by four nodes, the first being left padded with zeros, resulting in
| 002 | 101 | 453 | 788 |
Your program will need to overload the arithmetic operators + and
Each number input to the program shall have its own linked list and the result of the arithmetic shall be stored in a results linked list. The final result of the arithmetic operation shall be output to the console, with each part of the number listed with its node location.
Example:
If we wanted to add 10,000 and 845 the output result would be:
The answer is
Node 1 = 010
Node 2 = 845
Giving 10,845
Language: C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
