public class Powers
{
public static void main(String[] args){
ConsoleIO console = new ConsoleIO();
int input;
int numOneTensLow = 10;
int numTwoTensLow = 20;
int numThreeTensLow = 30;
int numOneOnesLow = 4;
int numTwoOnesLow = 5;
int numThreeOnesLow = 6;
int numOneTensHigh = 90;
int numTwoTensHigh = 80;
int numThreeTensHigh = 70;
int numOneOnesHigh = 6;
int numTwoOnesHigh = 5;
int numThreeOnesHigh = 4;
int numOneLowOne = numOneTensLow + numOneOnesLow;
int numTwoLowOne = numTwoTensLow + numTwoOnesLow;
int numThreeLowOne = numThreeTensLow + numThreeOnesLow;
int numOneHighOne = numOneTensHigh + numOneOnesHigh;
int numTwoHighOne = numTwoTensHigh + numTwoOnesHigh;
int numThreeHighOne = numThreeTensHigh + numThreeOnesHigh;
int numOneLowTwo = numOneTensLow + numOneOnesLow;
int numTwoLowTwo = numTwoTensLow + numThreeOnesLow;
int numThreeLowTwo = numThreeTensLow + numTwoOnesLow;
int numOneHighTwo = numOneTensHigh + numOneOnesHigh;
int numTwoHighTwo = numTwoTensHigh + numThreeOnesHigh;
int numThreeHighTwo = numThreeTensHigh + numTwoOnesHigh;
int numOneLowThree = numOneTensLow + numTwoOnesLow;
int numTwoLowThree = numTwoTensLow + numOneOnesLow;
int numThreeLowThree = numThreeTensLow + numThreeOnesLow;
int numOneHighThree = numOneTensHigh + numTwoOnesHigh;
int numTwoHighThree = numTwoTensHigh + numOneOnesHigh;
int numThreeHighThree = numThreeTensHigh + numThreeOnesHigh;
int numOneLowFour = numOneTensLow + numTwoOnesLow;
int numTwoLowFour = numTwoTensLow + numThreeOnesLow;
int numThreeLowFour = numThreeTensLow + numOneOnesLow;
int numOneHighFour = numOneTensHigh + numTwoOnesHigh;
int numTwoHighFour = numTwoTensHigh + numThreeOnesHigh;
int numThreeHighFour = numThreeTensHigh + numOneOnesHigh;
int numOneLowFive = numOneTensLow + numThreeOnesLow;
int numTwoLowFive = numTwoTensLow + numOneOnesLow;
int numThreeLowFive = numThreeTensLow + numTwoOnesLow;
int numOneHighFive = numOneTensHigh + numThreeOnesHigh;
int numTwoHighFive = numTwoTensHigh + numOneOnesHigh;
int numThreeHighFive = numThreeTensHigh + numTwoOnesHigh;
int numOneLowSix = numOneTensLow + numThreeOnesLow;
int numTwoLowSix = numTwoTensLow + numTwoOnesLow;
int numThreeLowSix = numThreeTensLow + numOneOnesLow;
int numOneHighSix = numOneTensHigh + numThreeOnesHigh;
int numTwoHighSix = numTwoTensHigh + numTwoOnesHigh;
int numThreeHighSix = numThreeTensHigh + numOneOnesHigh;
int lowproductone = (numOneLowOne * numTwoLowOne * numThreeLowOne);
int highproductone = (numOneHighOne * numTwoHighOne * numThreeHighOne);
int lowproducttwo = (numOneLowTwo * numTwoLowTwo * numThreeLowTwo);
int highproducttwo = (numOneHighTwo * numTwoHighTwo * numThreeHighTwo);
int lowproductthree = (numOneLowThree * numTwoLowThree * numThreeLowThree);
int highproductthree = (numOneHighThree * numTwoHighThree * numThreeHighThree);
int lowproductfour = (numOneLowThree * numTwoLowThree * numThreeLowThree);
int highproductfour = (numOneHighFour * numTwoHighFour * numThreeHighFour);
int lowproductfive = (numOneLowFive * numTwoLowFive * numThreeLowFive);
int highproductfive = (numOneHighFive * numTwoHighFive * numThreeHighFive);
int lowproductsix = (numOneLowSix * numTwoLowSix * numThreeLowSix);
int highproductsix = (numOneHighSix * numTwoHighSix * numThreeHighSix);
System.out.println("This program will calculate three two-digit" +
" numbers that create the lowest and highest possible products " +
"using the numbers 1 through 9 once in each.");
System.out.println("To calculate the highest input 1, to calculate" +
" the lowest, input 0: ");
input = console.readInt();
if(input == 0){
{
System.out.println(lowproductone);
System.out.println(lowproducttwo);
System.out.println(lowproductthree);
System.out.println(lowproductfour);
System.out.println(lowproductfive);
System.out.println(lowproductsix);
}
else(input == 1);
System.out.println(highproductone);
System.out.println(highproducttwo);
System.out.println(highproductthree);
System.out.println(highproductfour);
System.out.println(highproductfive);
System.out.println(highproductsix);
}
}}}}