Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.io.IOException; import java.io.File; import java.util.Scanner; import static java.lang.System.; public class TheLineRunner public static void main String args throws IOException Scanner file -new Scanner (new
import java.io.IOException; import java.io.File; import java.util.Scanner; import static java.lang.System.; public class TheLineRunner public static void main String args throws IOException Scanner file -new Scanner (new File("line.dat")) int sizefile.nextInt) file.nextLine ; for(int i-0 i largest) largestnum; import static java.lang.System.* public class TheLine private String line; public TheLine() public TheLine(String s) public int getLargest() int largest Integer.MIN VALUE; return largest: public String toString( ) return ""; 564 33 654 8321 15 10 225 4557 254 22 39 22 45 33 11 19 1 2 3 45 67 -10 9 1 8-999 -1 2 3 45 6 7 0 34 45 23 12 Lab Description Read in one line of text at a time. Each line will contain a group of numbers. Determine which number in the group is the largest. Sample Data 564 33 654 8321 15 10 225 4557 25 22 39 22 45 33 11 19 12 3456 -10 91 a-999 -1 2 3 4567 0 4 45 2] 12 Files Needed: TheLine.java TheLineRunner.java Sample Output 564 33 54 8321 15 -Larges8321 algorithm help- getlargest 10 225 4557 25Largest557 22 39 22 45 33 11 19Largest45 1 234567Largest -10 9 1 a -999-Largest9 -1 2 3 4567Largest 34 45 2] 12 - Largest -- 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started