All pastes #218358 Raw Edit

Miscellany

public text v1 · immutable
#218358 ·published 2006-10-24 03:44 UTC
rendered paste body
public class StairDesign {

        /**
         * Asks the operator whether the steps are for outside or indoor use,
         * and prompts for the total rise and total run of the stairs.
         */

        public static void main(String argv[]) {
                Scanner sc = new Scanner(System.in);
                Steps cdesi = new Steps();;
                StepEvaluator ceval = new StepEvaluator();
                String loc;
                StepSpec ret;
                double rise, run, irise = 6.0;

                System.out.print("Indoor or outdoor Stairs? ");
                loc = sc.next();

                if (loc.equalsIgnoreCase("indoor"))
                        irise = 7.0;

                System.out.print("Total rise: ");
                rise = sc.nextDouble();
                System.out.println();

                System.out.print("Total run: ");
                run = sc.nextDouble();
                System.out.println();
                ret = cdesi.computeDesign(rise, run, ceval, irise);

                System.out.println ("Stair design: ");
                System.out.println (ret.getStepCount() + " stairs");
                System.out.println ("Step rise " + ret.getStepCount());
                System.out.println ("Step run " + ret.getRun());
        }