Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package edu.onuft.tia.cp131;
- /**
- *
- * @author HomePC
- */
- public class Worker {
- private int Haurs;
- private String Name;
- private static int moneyPerHour;
- private static int tax;
- static{
- moneyPerHour = 100;
- tax = 5;
- }
- Worker(String aName, int aHours) {
- Name = aName;
- Haurs = aHours;
- }
- Worker(String aName, int aHours, int mph, int aTax) {
- Name = aName;
- Haurs = aHours;
- moneyPerHour = mph;
- tax = aTax;
- }
- public void getSalary() {
- int a=Haurs*moneyPerHour;
- int b = a/100 * tax;
- System.out.println(Name + " начислено: " + a + " налог=" + b + " получит=" + (a-b) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement