PersonalityTest.java - package week7 The assignment...

This preview shows page 1 - 2 out of 3 pages.

package week7;/* The assignment involves computing personality test data. */import java.io.*;import java.util.*;public class PersonalityTest {public static final int DIMENSIONS = 4;public static final int[] DIMENSIONDIVISION = {10, 20, 20, 20};public static final String[][] DIMENSIONOPTIONS = {{"E", "I"}, {"S","N"}, {"T", "F"}, {"J", "P"}};public static void main(String[] args) throws IOException {Scanner console = new Scanner(System.in); // scanner to read user inputuserIntro();System.out.print("input file name? ");// scanner to import data from user specified input fileScanner input = new Scanner(new File(console.next()));System.out.print("output file name? ");// PrintStream to write to a user specified output filePrintStream output = new PrintStream(new File(console.next()));while (input.hasNextLine()) {// while loop to go throughinput fileoutput.print(input.nextLine() + ": ");// print name to the output fileString line = input.next();String[] lineBreakdown = new String[4];// creating an array to store the line breakdownlineBreakdown = getLineBreakdown(line); // calling a method to populate the new array

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture