/* SingleBranch.java David G. Klick September 19, 2007 CIS 111 Demonstrates if-then for one-way branching. */ public class SingleBranch 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 gross = hours * rate; if (hours > 40) { gross = gross + (hours - 40) * (rate / 2); } // display gross println("The gross pay is " + gross); } }