Question: program output public class CostCalculator { public static int calculateCost(int age, int units) { int cost; if (age > 17 && age 15) { cost

program output

public class CostCalculator { public static int calculateCost(int age, int units) { int cost; if (age > 17 && age <= 29) { if (units > 15) { cost = (units - 15) * 400; } else { cost = 0; } } else { if (units < 12) { cost = units * 400; } else { cost = (units - 11) * 500 + 300; } } return cost; } public static void main(String[] args) { int costReturned = calculateCost(34, 19); System.out.println(costReturned); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!