Question: Instructions Lab 5 . 6 - Maximum of Data from Two Files - ( TwoFileMax ) The data files, data 1 . text and data

Instructions
Lab 5.6- Maximum of Data from Two Files -(TwoFileMax)
The data files, data1. text and data2. text each contains a header value followed by that number of integers. Write a program that opens the two data files (so you will need to declare and create two Scanners - one for each file), and reads in one number from each file and prints out the larger of the two and which file it cam from. You can assume the header values are always the same.
Sample Test Run
For example, if the file data1. text contains:
3
12
3
45
and the file data2. text contains:
3
9
14
102
the program should produce the following output:
'The larger of 12 and 9 is 12 and comes from data1.text
The larger of 3 and 14 is 14 and comes from data2. text
The larger of 45 and 102 is 102 and comes from data2. text
Additional Notes:
Your class should be named TwoFileMax.
data2.text and data1.text should not be modified
Regarding your code's standard output, CodeLab will check for case errors and will check whitespace (tabs, spaces, newlines) exactly except that it will ignore all trailing whitespace.
DO NOT USE ARRAYS YOU MAY USE LOOPS IF NEEDED (beginner functions)
Instructions Lab 5 . 6 - Maximum of Data from Two

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 Programming Questions!