Created
October 28, 2012 21:12
-
-
Save benfb/3969931 to your computer and use it in GitHub Desktop.
GCDRunner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//import Scanner | |
import java.util.Scanner; //imports only scanner | |
public class GCDRunner | |
{ | |
//main method | |
public static void main(String[] args) | |
{ | |
//instantiate Scanner object | |
Scanner scan = new Scanner(System.in); | |
//prompt user for numerator | |
System.out.println("Enter the numerator: "); | |
//assign user input to variable | |
int numerator = scan.nextInt(); | |
//prompt user for denominator | |
System.out.println("Enter the denominator: "); | |
//assign user input to variable | |
int denominator = scan.nextInt(); | |
//instantiate GCD object | |
GCD gcd = new GCD(numerator, denominator); | |
//call toString() method | |
System.out.println(gcd.toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment