View Single Post
  #2 (permalink)  
Old April 14th, 2011, 05:00 PM
sergeySE sergeySE is offline
Registered User
 
Join Date: Apr 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is an examples of a source code.
I agree that this book is a bit too " concentrated " .But additional reading (see p.28 http://download.oracle.com/javase/tu...ava/index.html
)
will do the job ,at least for me .

public class TestTax {


public static void main(String[] args) {
if (args.length !=3){
System.out.println("Sample usage of the program: " +
" java TestTax 50000 NJ 2");
System.exit(0);
}

double grossIncome = Double.parseDouble(args[0]);
String state = args[1];
int dependents = Integer.parseInt(args[2]) ;






Tax t = new Tax();

double yourTax = t.calcTax(grossIncome, state, dependents); //calculating tax


System.out.println("Your tax is " + yourTax);



}

}

Last edited by sergeySE; April 14th, 2011 at 05:14 PM..
Reply With Quote