DivisorCalcTest - Scanner sc = new Scanner(System.in); while

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

View Full Document Right Arrow Icon
//******************************************************************** // DivisorCalcTest.java Author: Lewis/Loftus // // Solution to Programming Project 11.2 // // Driver program used to test DivisorCalc class //******************************************************************** import java.util.Scanner; i public class DivisorCalcTest { p public static void main (String args[]) { int u; int v; String another = "y"; System.out.println("GCD tester\n");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Scanner sc = new Scanner(System.in); while (another.equalsIgnoreCase("y")) { System.out.println("Enter first number: "); u = Integer.parseInt(sc.nextLine()); System.out.println("Enter second number: "); v = Integer.parseInt(sc.nextLine()); System.out.println("GCD of " + u + " and " + v + " is " + DivisorCalc.gcd(u,v)); System.out.println("Compute another GCD (y/n)? "); another = sc.nextLine(); } } }...
View Full Document

Ask a homework question - tutors are online