Tech Support Guy banner
Status
Not open for further replies.
1 - 4 of 4 Posts

·
Registered
Joined
·
4 Posts
Discussion Starter · #1 ·
This is my code. I got it down to one error. It wants me to put a semicolon in MakeSec(){ but when I do, it makes 100 errors. Any ideas?

/**
* @(#)Combination_Cracker.java
*
* Combination_Cracker application
*
* Mitchell Taylor
* Version 1.00 2009/7/14
*/

import java.io.*;
import java.util.Scanner;

public class Combination_Cracker {

public static void main(String[] args) throws IOException{
Scanner keyboard = new Scanner(System.in);

java.io.File listroot = new java.io.File("c:/");
java.io.File[] files = listroot.listFiles();

System.out.println("Print root files from c:");

for (java.io.File file : files) {
if (file.isDirectory())
continue;
System.out.println(file.getPath());

MakeSec(){
// This subroutine creates the variables for the second number in the combination
int SecondA=Second;
int SecondB=SecondA + 4;
int SecondC=SecondB + 4;
int SecondD=SecondC + 4;
int SecondE=SecondD + 4;
int SecondF=SecondE + 4;
int SecondG=SecondF + 4;
int SecondH=SecondG + 4;
int SecondI=SecondH + 4;
int SecondJ=SecondI + 4;
space="/n";
}

System.out.println("enter your number");

int Third=keyboard.nextInt();
int remainder=Third % 4;
int FirstA=remainder;
int FirstB=FirstA + 4;
int FirstC=FirstB + 4;
int FirstD=FirstC + 4;
int FirstE=FirstD + 4;
int FirstF=FirstE + 4;
int FirstG=FirstF + 4;
int FirstH=FirstG + 4;
int FirstI=FirstH + 4;
int FirstJ=FirstI + 4;
if (remainder==0) { int Second=2;
MakeSec();
}
else if (remainder==1) { int Second=3;
MakeSec();
}
else if (remainder==2) { int Second=0;
MakeSec();
}
else if (remainder==3) { int Second=1;
MakeSec();
}
space="/n";

System.out.println("possible combos" + FirstA + ", " + SecondA + ", " + Third);
System.out.println(space);
System.out.println(FirstA + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstB + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstC + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstD + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstE + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstF + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstG + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstH + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstI + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondI + ", " + Third + "/n");

}

if (remainder==1) { int Second=3;
int SecondA=Second;
int SecondB=SecondA + 4;
int SecondC=SecondB + 4;
int SecondD=SecondC + 4;
int SecondE=SecondD + 4;
int SecondF=SecondE + 4;
int SecondG=SecondF + 4;
int SecondH=SecondG + 4;
int SecondI=SecondH + 4;
int SecondJ=SecondI + 4;
System.out.println("possible combinations:" + FirstA + ", " + SecondA + ", " + Third + "/n");

System.out.println(FirstA + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstB + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstC + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstD + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstE + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstF + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstG + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstH + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstI + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondI + ", " + Third + "/n");

}

if (remainder==2) { int Second=0;
int SecondA=Second;
int SecondB=SecondA + 4;
int SecondC=SecondB + 4;
int SecondD=SecondC + 4;
int SecondE=SecondD + 4;
int SecondF=SecondE + 4;
int SecondG=SecondF + 4;
int SecondH=SecondG + 4;
int SecondI=SecondH + 4;
int SecondJ=SecondI + 4;
System.out.println("possible combinations:" + FirstA + ", " + SecondA + ", " + Third + "/n");

System.out.println(FirstA + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstB + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstC + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstD + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstE + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstF + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstG + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstH + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstI + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondI + ", " + Third + "/n");

};

if (remainder==3) { int Second=1;
int SecondA=Second;
int SecondB=SecondA + 4;
int SecondC=SecondB + 4;
int SecondD=SecondC + 4;
int SecondE=SecondD + 4;
int SecondF=SecondE + 4;
int SecondG=SecondF + 4;
int SecondH=SecondG + 4;
int SecondI=SecondH + 4;
int SecondJ=SecondI + 4;
System.out.println("possible combinations:" + FirstA + ", " + SecondA + ", " + Third + "/n");

System.out.println(FirstA + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstA + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstB + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstB + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstC + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstC + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstD + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstD + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstE + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstE + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstF + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstF + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstG + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstG + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstH + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstH + ", " + SecondI + ", " + Third + "/n");

System.out.println(FirstI + ", " + SecondA + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondB + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondC + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondD + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondE + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondF + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondG + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondH + ", " + Third + "/n");
System.out.println(FirstI + ", " + SecondI + ", " + Third + "/n");

};

}

}
 

·
Registered
Joined
·
72 Posts
I don't know Java but aren't you missing two closing braces } in the main function. One for the for loop and the other to close the function body.

public static void main(String[] args) throws IOException
{
Scanner keyboard = new Scanner(System.in);

java.io.File listroot = new java.io.File("c:/");
java.io.File[] files = listroot.listFiles();

System.out.println("Print root files from c:");

for (java.io.File file : files)
{
if (file.isDirectory())
continue;
System.out.println(file.getPath());
}
}
 

·
Registered
Joined
·
305 Posts
It's been ages since I did any Java and have tried to wipe it from my memory. I'd agree with Aftab that your brackets don't add up in general. Also, I don't think MakeSec() is a valid funtion definition. It does not have a return type (needs a void before it).

Probably best export that outside the main function anyway, I'm not sure if local function definitions are valid in main. Even if they are, I'd call it bad style as it's a bit big and could go outside the main function just as easily.

Also, see if you can export the mass println calls to a fuction too. It should make what your doing easier to read - and easier to match up the brackets.
 

·
Registered
Joined
·
290 Posts
There's no such thing as a subroutine in Java. You can't declare Second outside of MakeSec() and then use it in MakeSec() without passing it as an argument, and you can't declare/modify SecondA...I inside of MakeSec() and then use them outside of MakeSec() without returning them in some data structure.

burnthepc is also right in saying you can't define a method inside another method.

Your program is about 530 lines when the same thing could be accomplished in about 70 lines in a much more readable fashion if you used arrays. I suggest reading up on arrays before you proceed with this project.
 
1 - 4 of 4 Posts
Status
Not open for further replies.
Top