InClassExercise12

InClassExercise12 - CS112: In-class Exercise 12 Reading...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS112: In-class Exercise 12 1. Create a new project files-12 . 2. Grab the data files “data1.txt” and “data2.txt” from the downloads page, 3. Create a new class, called Testing . Delete everything but the outer wrapper. 4. In this Testing class, create the following methods. There are no instance variables for this class. We are just going to write and test methods. Remember to import appropriate classes before the outer wrapper so that we have to ability to read files. Write a void method, getMinFromFile(String filename) throws Exception that will open the file filename , then read the data from it, and finds the minimum of the numbers, and print to the Terminal Window the result. Assume that the file has the following format. The first number is the number of actual data in the file. The rest of the numbers are integer data. You will declare (as local) and instantiate the File object and Scanner objects inside this method. Create a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

InClassExercise12 - CS112: In-class Exercise 12 Reading...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online