import java.util.Scanner; /** * CS151 Fall 2007 Lab #6 Solution
* Gets input from the user using the Scanner class and executes methods from the * CSMath class using the user's inputs. * * @author Scott Russell * @version 10/10/2007, last modified 10/12/2007 */ public class CSMathApplication { public static void main(String[] args) { //create a way for the user to enter input Scanner input = new Scanner(System.in); //get input from the user System.out.print("Please enter a positive integer: "); int value = input.nextInt(); System.out.println("The number of binary digits needed for " + value + " is " + CSMath.numberOfBinaryDigits(value) + "."); System.out.print("\nPlease enter the number of Fibonacci number to display " + "(a positive integer): "); value = input.nextInt(); CSMath.displayFibonacciNumbers(value); System.out.print("\nPlease enter the (positive) integer you would like to factor: "); value = input.nextInt(); CSMath.displayIntegerFactors(value); } }