Question
# Largest Number **Files Needed** * TheLine.java * TheLineRunner.java * line.dat **Lab Goal** : The lab was designed to teach you more about using data
# Largest Number
**Files Needed**
* TheLine.java
* TheLineRunner.java
* line.dat
**Lab Goal** : The lab was designed to teach you more about using data files
**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.
**Algorithm Help**
largest = Integer.MIN_VALUE
while( there are more numbers to check )
{
num = get current number
if(num > largest)
largest = num
}
**Sample Data**
data contained in line.dat
7
564 33 654 8321 15
10 225 4557 254
22 39 22 45 33 11 19
1 2 3 4 5 6 7
-10 9 1 8 -999
-1 2 3 4 5 6 7
0 34 45 23 12
**Sample Output** :
564 33 654 8321 15 - Largest == 8321
10 225 4557 254 - Largest == 4557
22 39 22 45 33 11 19 - Largest == 45
1 2 3 4 5 6 7 - Largest == 7
-10 9 1 8 -999 - Largest == 9
-1 2 3 4 5 6 7 - Largest == 7
0 34 45 23 12 - Largest == 45
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