package com.company; public class wątroba { public String country; public float fatprocentage; public boolean sex; public int weight; public int hight; public int age; //public boolean sex; /* countries: pl- 1 ru- 1.2 us- 0,9 uk- 1,1 fat%: <10% - 0,5 10%> = x < 20% - 1 >=20% - 1,2 height; facet i <150cm - 0,5 facet i <170, ale min 150 - 0,7 facet i >=170 - 1 kobieta i <140cm - 0,5 kobieta i <160, ale min 140 - 0,7 kobieta i >=160 - 1 wiek: do 15 lat 3g/kg >=15 lat 8g/kg 65< 6g/kg masa: jeżeli facet i poniżej 60kg - 0.8 jezeli facet i powyżej 60kg - 1 jeżeli kobieta i poniżej 50 kg - 0.8 jeżeli kobieta i powyżej 50 kg - 1 */ wątroba() { country = "pl"; fatprocentage = 20.0F; weight = 100; hight = 192; age = 16; sex = false; } public int countBeerAmount(int alcprocentage, int volume) { int result = 0; float factorsexweight=0; float factorcountry=0; float factorsexhaight=0; //sex and weight if(false==sex) { if(weight<60) factorsexweight=0.8F; else factorsexweight = 1F; } else { if(weight<50) factorsexweight=0.7F; else factorsexweight = 1F; } //countries if(country.equals("pl")) { factorcountry=1F; } else if(country.equals("ru")) { factorcountry=1.2F; } else if (country.equals("us")) { factorcountry=0.9F; } else if (country.equals("uk")) { factorcountry = 1.1F; } //height if(false==sex) { if (hight<150) factorsexhaight=0.5F; else if (hight<170 && hight>150) factorsexhaight= 0.7F; else if (hight>=170) factorsexhaight=1F; } return result; } }