Find Jobs
Hire Freelancers

Easy Java Linked List Node file

$30-250 USD

In Progress
Posted over 14 years ago

$30-250 USD

Paid on delivery
It is sometimes desirable to be able to handle numbers of arbitrary size, without having to consider the limit of the machine representation or to rely on a utility library(e.g., [login to view URL]). A linked list, implemented with pointers and dynamic memory allocation, is a natural solution: we obtain storage to hold digits only when necessary. Such an approach is called infinite precision arithmetic. To represent a large number such as 15,000,701,800,029 with a linked list, we could simply create a node for each digit. However, to make more efficient use of memory, we store an integer between 0 and 999 in each node, which gives the effect of base-1, 000 numbers. For example, the number above can be represented by a five-node list (15, 0, 701, 800, 29 ). You will be provided with a data file called “[login to view URL]” containing several pairs of large numbers. Each number is given on a separate line and there is an empty line between two pairs. You Java program should read and echo each pair of numbers, compute and report their sum and product, and go on to process the next pair until the end of input. Put your solution in the form of a class named LargeNumbers, which uses the Node class to provide nodes for the linked list representation. There should be, among other things, - a method to read from file - a method to put a large number into a linked list - a method to add two large numbers - a method to multiply two large numbers - a method to output a large number The main method must look like this pseudo-code: While( not end of input) { Read and echo a pair of numbers N1 and N2; Output sum (N1, N2) ; Output product(N1, N2); } So here’s a sample output: LargeNumber1: 1 506 033 005 018 000 029 LargeNumber2: 1 992 Sum is: (whatever the sum is) Product is: ( whatever the product is)
Project ID: 471107

About the project

4 proposals
Remote project
Active 15 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hey Please check your PMB Thanks
$30 USD in 0 day
5.0 (54 reviews)
6.1
6.1
4 freelancers are bidding on average $48 USD for this job
User Avatar
I have already made the same idea for Deal number generator, so I can refactor my implementation to match your requirement. Best regards, Hadi
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
my expertise!
$100 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi, i will do it for you to the monday (17). I look forward to hearing from you. Pablo
$30 USD in 2 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
new york, United States
4.0
5
Member since May 2, 2009

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.