Create a week 7 Java project. Eight text files have been provided in the week 7...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a week 7 Java project. Eight text files have been provided in the week 7 practical zip file. Copy the eight text files into the root folder of the project. In the exercises below you will write java code to read the data from these text files. The code will be very similar for each program. Do not use arrays or arraylists in any of these programs. There are several example files in the week 6 lecture which will assist with several aspects of this question. i) The numbers.txt file consists of multiple whole numbers, one number per line. Write a java program named ReadNumber File1.java that reads the data from numbers.txt and displays the data to the screen (one number per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that only whole numbers will be in the file). Test that your code works correctly by running the program using numbers1.txt, numbers2.txt, and numbers99. txt as the input file. ii) The numbers3.txt file consists of multiple whole numbers, two numbers per line separated by a space. Write a java program named ReadNumberFile2.java that reads the data from numbers3.txt and displays the data to the screen (two numbers per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that only whole numbers will be in the file). Test that your code works correctly by running the program using numbers3.txt, numbers4.txt, and numbers 99.txt as the input file. iii) The numbers5.txt file consists of multiple whole numbers, three numbers per line separated by a space. Write a java program named ReadNumberFile3.java that reads the data from numbers5.txt and displays the data to the screen (three numbers per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that only whole numbers will be in the file). Test that your code works correctly by running the program using numbers5.txt, and numbers99.txt as the input file. iv) The numbers6. txt file consists of multiple whole numbers and floating-point numbers, three numbers per line (in the order whole number, floating point number, whole number) separated by a space. Write a java program named ReadNumberFile4.java that reads the data from numbers6.txt and displays the data to the screen (three numbers per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that the first and third number on every line is a whole number, and that the second number on every line is a floating-point number). Test that your code works correctly by running the program using numbers6.txt, and numbers 99.txt as the input file. v) The numbers7.txt file consists of multiple whole numbers and strings, three values per line (in the order whole number, string, whole number) separated by a space. Write a java program named ReadNumberFile4.java that reads the data from numbers7.txt and displays the data to the screen (three values per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that the first and third number on every line is a whole number, and that the second value on every line is a string). Test that your code works correctly by running the program using numbers7.txt, and numbers99.txt as the input file. Create a week 7 Java project. Eight text files have been provided in the week 7 practical zip file. Copy the eight text files into the root folder of the project. In the exercises below you will write java code to read the data from these text files. The code will be very similar for each program. Do not use arrays or arraylists in any of these programs. There are several example files in the week 6 lecture which will assist with several aspects of this question. i) The numbers.txt file consists of multiple whole numbers, one number per line. Write a java program named ReadNumber File1.java that reads the data from numbers.txt and displays the data to the screen (one number per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that only whole numbers will be in the file). Test that your code works correctly by running the program using numbers1.txt, numbers2.txt, and numbers99. txt as the input file. ii) The numbers3.txt file consists of multiple whole numbers, two numbers per line separated by a space. Write a java program named ReadNumberFile2.java that reads the data from numbers3.txt and displays the data to the screen (two numbers per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that only whole numbers will be in the file). Test that your code works correctly by running the program using numbers3.txt, numbers4.txt, and numbers 99.txt as the input file. iii) The numbers5.txt file consists of multiple whole numbers, three numbers per line separated by a space. Write a java program named ReadNumberFile3.java that reads the data from numbers5.txt and displays the data to the screen (three numbers per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that only whole numbers will be in the file). Test that your code works correctly by running the program using numbers5.txt, and numbers99.txt as the input file. iv) The numbers6. txt file consists of multiple whole numbers and floating-point numbers, three numbers per line (in the order whole number, floating point number, whole number) separated by a space. Write a java program named ReadNumberFile4.java that reads the data from numbers6.txt and displays the data to the screen (three numbers per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that the first and third number on every line is a whole number, and that the second number on every line is a floating-point number). Test that your code works correctly by running the program using numbers6.txt, and numbers 99.txt as the input file. v) The numbers7.txt file consists of multiple whole numbers and strings, three values per line (in the order whole number, string, whole number) separated by a space. Write a java program named ReadNumberFile4.java that reads the data from numbers7.txt and displays the data to the screen (three values per line of output). Ensure that your program works correctly for different length files (eg, longer files, shorter files, files with no data) and for files that don't exist. Your program will need to use appropriate try-catch statements (note: in this exercise you can assume that the first and third number on every line is a whole number, and that the second value on every line is a string). Test that your code works correctly by running the program using numbers7.txt, and numbers99.txt as the input file.
Expert Answer:
Related Book For
Integrated Accounting
ISBN: 978-1285462721
8th edition
Authors: Dale A. Klooster, Warren Allen, Glenn Owen
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
Which of the following statements about an acquiescence is correct? a. Acquiescences are published only for certain regular decisions of the U.S. Tax Court. b. The IRS does not issue acquiescences to...
-
a). A recent study by economists Steven Puller and Lisa Taylor found that airline tickets purchased over the weekend were priced 5% lower on average. Why would airlines charge lower prices to...
-
Evaluate the definite integral. Use a graphing utility to verify your result. C/4 J/8 (csc 20 cot 20) de
-
Zachary and Carrie Sexton (the Buyers) were searching for a home in the Kings wood neighborhood of Atlanta, Georgia. The Buyers real estate agent learned that Russell and Linda Sewell (the Sellers)...
-
Parker Hi-Fi Systems, located in Wellesley, Massachusetts, a Boston suburb, assembles and sells the very finest home theater systems. The systems are assembled with components from the best...
-
Explore the procedure for ethical decision-making in the face of conflicting obligations, as described in Chapter 2. List the various conflicting obligations that Goldman Sachs executives might have...
-
Ramsey Liquors owns and operates a chain of beer and wine shops throughout the Dallas-Fort Worth metroplex. The rapidly expanding population of the area has resulted in the firm requiring a growing...
-
The setup used in our laboratory produces entangled photons through the process of spon- taneous parametric down conversion. It uses a birefringent crystal to convert UV photons (400 nm) into two IR...
-
Consider the linear transformation T : P2(R) P2(R) given by T() = 2f', where f' is the usual derivative of f. (a) (4 points) Let S == {1, x, x2} be the standard basis of P2(R). Find [T(S,S)] the...
-
Create a system in JAVA that will check if the number is a Prime Number or not. You are also required to draw the flowchart diagram and write the pseudocode for this program. After the user enters a...
-
Reflect on a time when a supervisor or professor announced a change that you, the worker/student, did not want to adopt. What were the reasons for your resistance to change? Was the...
-
What were some of Nick's challenges when asked to implement his superior's vision for the newspaper? . Discuss your reaction to Nick's story. Identify one of Tim's leadership traits (i.e....
-
A) What should you consider when developing, implementing, monitoring, and reviewing strategies to support the inclusion of all children? How can you work with relevant other stakeholders to plan and...
-
We have a 7 segment decoder circuit that can display different numbers and alphabets when different inputs are applied. We also can generate some error bits on 7 segments which dont occur with the...
-
Consider the discrete group G of order 8 that has the following Cayley diagram e If we have the sequence of operations: fcagec, which of the options represents the reduction of the sequence to a...
-
The following problem provides practice of the applications described in this chapter. Step 1: Remove the Audit Test Questions 1-B at the end of this problem and fill in the answers as you work...
-
What is the total amount of assets shown on the accounting equation report?
-
Briefly describe the closing entries automatically generated by the computer.
-
Xenon oscillations are a phenomenon at higher levels of power where xenon-135 loss due to neutron capture is dominant. For example, in a typical large thermal environment, if Xe-135 burnup is 10...
-
Explain the plant states considered for safety analysis and the advantages of new states.
-
Explain the relative criteria that can provide relative safety in nuclear reactors.
Study smarter with the SolutionInn App