/* TwoBranch.java David G. Klick September 19, 2007 CIS 111 Demonstrates if-then-else for two-way branching. */ public class TwoBranch extends CIS111App { public static void main(String[] args) { double hours; double rate; double gross; // get hours and rate hours = getDouble("Enter hours worked: "); rate = getDouble("Enter hourly rate: "); // calc gross if (hours > 40) { gross = (40 * rate) + (hours - 40) * (rate * 1.5); } else { gross = hours * rate; } // display gross println("The gross pay is " + gross); } }