Advertisement
wsx22

Untitled

Sep 16th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. class Employee {
  2.     String firstName;
  3.     String lastName;
  4.     double salary;
  5.     double bonus;
  6.    
  7.     void printTotalSalary() {
  8.         double totalSalary = salary + bonus;
  9.         String message = "Całkowita wypłata: " + totalSalary;
  10.         System.out.println(message);
  11.     }
  12. }
  13. class Company {
  14.     public static void main(String[] args) {
  15.         Employee emp = new Employee();
  16.         emp.firstName = "Jan";
  17.         emp.lastName = "Kowalski";
  18.         emp.salary = 5000;
  19.         emp.bonus = 500;
  20.         emp.printTotalSalary();
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement