Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I got some errors, can you help me figure out these? 1 import java.util. blic class longNumbersLinkedListSkeleton 6 public static void main(String args) Scanner stdin

I got some errors, can you help me figure out these? image text in transcribed
image text in transcribed
1 import java.util. blic class longNumbersLinkedListSkeleton 6 public static void main(String args) Scanner stdin new Scanner (System-in); String longNumber; LinkedList manList = new LinkedList(); LinkedList sumLst = new LinkedList ( ); LinkedList temp = null; 10 13 int maxWidth=0, currWidth=0; System.out.println( "Enter Numbers or Press-1 to end) 15 16 17 18 19 20 21 while(true) temp-new LinkedList longNumber-stdIn.nextLine(): if (longNumber.equals(-1)) 23 24 25 26 27 28 29 30 3 1 32 for (int i#0;imaxwidth) maxWidthcurrWidth; int t = c-48; temp.addFirst(t): mainList.addFirst (temp); currWidth = 0; 34 35 36 3 7 38 39 40 4 1 42 43 int car for ( int 1-0 ; i 0) 45 46 47 48 49 50 51 52 53 sum = sum + temp.removeFirst ( ); sum += carry ; sumList.addFirst (sum% 10) ; carry = sum / 10; System.out.println( The sum: if (carry> 0) System.out.print (carry):L for ( int i=0;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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