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(&quot;cycles&quot; + i + &quot;.txt&quot;)); answer = in.nextLine(); if (answer.equals(algo.hasCycles())) { cyclesPassed++; } in.close(); } catch (Exception ex) { ex.printStackTrace(); } } System.out.println(&quot;Connected: &quot; + connectedPassed + &quot; out of 10&quot;); System.out.println(&quot;Cycles: &quot; + cyclesPassed + &quot; out of 10&quot;); } }...
View Full Document

Ask a homework question - tutors are online