Advertisement
Guest User

asdasdas

a guest
Dec 13th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. public class Person {
  2. private String name;
  3. private int height;
  4. private double money;
  5.  
  6.  
  7. public Person(String name, int height, double money){
  8. this.name = name;
  9. this.height = height;
  10. this.money = money;
  11. }
  12.  
  13. static int addition(int firstValue, int secondValue){
  14. int result;
  15. result = firstValue + secondValue;
  16. return result;
  17. }
  18.  
  19. static void whoIsTaller(Person one, Person two){
  20. if (one.height > two.height){
  21. System.out.println(one.name + " is taller");
  22. } else if (one.height == two.height){
  23. System.out.println("Height is same");
  24. } else {
  25. System.out.println(two.name + " is taller");
  26. }
  27. }
  28.  
  29. static void paidForLLSurgery(Person test, String lldoctor){
  30. if (test.money < 80000){
  31. System.out.println("sorry not enough money");
  32. } else {
  33. test.money = test.money - 80000;
  34. System.out.println("paid for LL from " + lldoctor);
  35. }
  36. }
  37.  
  38. double checkBalance(){
  39. return this.money;
  40. }
  41.  
  42. static void printLoop(){
  43. for (int i = 0; i < 100000000; i ++ ){
  44. System.out.println(i);;
  45. }
  46. }
  47.  
  48.  
  49. public static void main(String args[]){
  50. // Person Aaron = new Person("Aaron", 165, 100000.0);
  51. // Person Doggy = new Person("Doggy", 155, 530.0);
  52. // System.out.println("Aaron money is " + Aaron.money);
  53. // paidForLLSurgery(Aaron, "doctorp aley");
  54. // System.out.println(Aaron.checkBalance());
  55. // whoIsTaller(Aaron, Doggy);
  56. System.out.println();
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement