Pure Programmer
Blue Matrix


Cluster Map

Project: Retirement Calculator

Write a program that determines if someone is eligible for retirement. It should accept two command line arguments. The first is the person's age. The second is the number of years of service with the company. A person is eligible for retirement if they are 67 or older or if they are 55 years or older with 25 or more years of service with the company.

Output
$ javac -Xlint RetirementCalculator.java $ java -ea RetirementCalculator 55 15 You can't retire yet! $ javac -Xlint RetirementCalculator.java $ java -ea RetirementCalculator 67 15 You may retire! $ javac -Xlint RetirementCalculator.java $ java -ea RetirementCalculator 56 25 You may retire! $ javac -Xlint RetirementCalculator.java $ java -ea RetirementCalculator 60 30 You may retire!

Solution