Advertisement
Valik888

Untitled

Sep 22nd, 2015
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package edu.onuft.tia.cp131;
  7.  
  8. /**
  9.  *
  10.  * @author HomePC
  11.  */
  12. public class Worker {
  13.     private int Haurs;
  14.     private String Name;
  15.    
  16.     private static int moneyPerHour;
  17.     private static int tax;
  18.    
  19.     static{
  20.         moneyPerHour = 100;
  21.         tax = 5;
  22.     }
  23.    
  24.     Worker(String aName, int aHours) {
  25.         Name = aName;
  26.         Haurs = aHours;
  27.     }
  28.    
  29.     Worker(String aName, int aHours, int mph, int aTax) {
  30.         Name = aName;
  31.         Haurs = aHours;
  32.         moneyPerHour = mph;
  33.         tax = aTax;
  34.     }
  35.    
  36.     public void getSalary() {
  37.         int a=Haurs*moneyPerHour;
  38.         int b = a/100 * tax;
  39.         System.out.println(Name + " начислено: " + a + " налог=" + b + " получит=" + (a-b) );
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement