icabit

multi methods

Jun 24th, 2011
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. import java.io.*;
  2. public class gg
  3. {
  4. public static double net=0;
  5. public static double x=0;
  6. static BufferedReader in = new BufferedReader (new InputStreamReader(System.in));
  7. public static void main(String args []) throws IOException
  8. {
  9. double net=0;
  10. double x=Input();
  11. double net1=calc(x);
  12. output(net1);
  13.  
  14. }
  15. private static double Input() throws IOException
  16. {
  17. double x =0;
  18. System.out.print("enter gross salary:");
  19. x= Double.parseDouble(in.readLine());
  20. return x;
  21. }
  22. private static double calc(double xx)
  23. {
  24.  
  25. double x=xx;
  26. double net1=0;
  27. net1= x*0.95;
  28. return net1;
  29. }
  30. private static void output(double n)
  31.  
  32. {
  33. double net = n;
  34. System.out.print("your net salary is :"+net);
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment