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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!