Question: Using this format import java.util.Scanner; import java.io.*; public class Analysis { /* * YOUR LAST NAME IN CAPS * ITP 120 - 004 */ public

 Using this format import java.util.Scanner; import java.io.*; public class Analysis {

Using this format

import java.util.Scanner;

import java.io.*;

public class Analysis

{

/*

* YOUR LAST NAME IN CAPS

* ITP 120 - 004

*/

public static void main(String[] args)

{

boolean loopflag = true;

Scanner keyboard = new Scanner(System.in);

while (loopflag)

and using

import java.util.Scanner; import java.io.*; public class Input_Loop_5 { public static void main(String[] args) { boolean loopflag = true; Scanner keyboard = new Scanner(System.in); while (loopflag) { System.out.println("Enter the filename or quit to quit: "); String filename = keyboard.nextLine(); if (filename.compareTo("quit") == 0) { loopflag = false; System.out.print("EXIT"); keyboard.close(); //Modification 1 } else //If the file exists, perform the task { try //page 705 { File file = new File(filename); Scanner inputFile = new Scanner(file); System.out.println("FILE FOUND"); System.out.println("Perform Analysis"); /* * 1. Create the Analysis class whose constructor requires * an array of integers * 2. Read the file into an array; instantiate an Analysis * object * 3. Call the Analysis method - test; which returns true if * the array is didatic; else it returns false */ inputFile.close(); } catch (FileNotFoundException e) { System.out.println("FILE NOT FOUND"); } } } } }

the two files are (aaa.txt) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

and

(bbb.txt) 8 11 14 1 13 2 7 12 3 16 9 6 10 5 4 15

1. Create the Didactic class, which will contain main 2. Create the Analysis class whose constructor requires an array of integers 3. In Didactic create an Input Loop which will repeatedly ask the user for a file name, until a valid file name is entered or until the use enters "quit" instead of a file name. The file is guaranteed to contain the 16 integers 1..16 Read the file into an array; instantiate an Analysis object Call the Analysis method - test; which returns true if the array is didatic; else it returns false 4. 5. 134 2712 34 3 16 9634 10 5 41534 16 32 13 510 118 9 6 7 12 4 1514 1 8 11141 34 34 34 34 34

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!