NormalTest - in.close i cycles in = new Scanner(new...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; import java.util.*; i public class NormalTest { public static void main(String[] args) { int connectedPassed = 0, cyclesPassed = 0; for (int i = 1; i <= 10; i++) { try { GraphAlgorithms algo = new GraphAlgorithms("graphs" + i + ".txt"); " // connected Scanner in = new Scanner(new File("connected" + i + ".txt")); String answer = in.nextLine(); if (answer.equals(algo.isConnected())) { connectedPassed++;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } in.close(); i // cycles in = new Scanner(new File("cycles" + i + ".txt")); answer = in.nextLine(); if (answer.equals(algo.hasCycles())) { cyclesPassed++; } in.close(); } catch (Exception ex) { ex.printStackTrace(); } } System.out.println("Connected: " + connectedPassed + " out of 10"); System.out.println("Cycles: " + cyclesPassed + " out of 10"); } }...
View Full Document

This note was uploaded on 11/08/2009 for the course ISYS 2350 taught by Professor Joserf during the Three '08 term at University of Sydney.

Ask a homework question - tutors are online