Facebook
From Crimson Lechwe, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 210
  1. package com.company;
  2.  
  3. public class wątroba {
  4.     public String country;
  5.     public float fatprocentage;
  6.     public boolean sex;
  7.     public int weight;
  8.     public int hight;
  9.     public int age;
  10.     //public boolean sex;
  11.  
  12.  
  13.     /*
  14.     countries:
  15.     pl- 1
  16.     ru- 1.2
  17.     us- 0,9
  18.     uk- 1,1
  19.     fat%:
  20.     <10% - 0,5
  21.     10%> = x < 20% - 1
  22.     >=20% - 1,2
  23.  
  24.     height;
  25.     facet i <150cm - 0,5
  26.     facet i <170, ale min 150 - 0,7
  27.     facet i >=170 - 1
  28.  
  29.     kobieta i <140cm - 0,5
  30.     kobieta i <160, ale min 140 - 0,7
  31.     kobieta i >=160 - 1
  32.  
  33.     wiek:
  34.     do 15 lat 3g/kg
  35.     >=15 lat 8g/kg
  36.     65< 6g/kg
  37.  
  38.     masa:
  39.     jeżeli facet i poniżej 60kg - 0.8
  40.     jezeli facet i powyżej 60kg - 1
  41.  
  42.     jeżeli kobieta i poniżej 50 kg - 0.8
  43.     jeżeli kobieta i powyżej 50 kg - 1
  44.     */
  45.  
  46.     wątroba() {
  47.         country = "pl";
  48.         fatprocentage = 20.0F;
  49.         weight = 100;
  50.         hight = 192;
  51.         age = 16;
  52.         sex = false;
  53.  
  54.     }
  55.         public int countBeerAmount(int alcprocentage, int volume)
  56.         {
  57.             int result = 0;
  58.             float factorsexweight=0;
  59.             float factorcountry=0;
  60.             float factorsexhaight=0;
  61.  
  62.  
  63.             //sex and weight
  64.             if(false==sex)
  65.             {
  66.                 if(weight<60)
  67.                     factorsexweight=0.8F;
  68.                 else
  69.                     factorsexweight = 1F;
  70.             }
  71.             else
  72.             {
  73.                 if(weight<50)
  74.                     factorsexweight=0.7F;
  75.                 else
  76.                     factorsexweight = 1F;
  77.             }
  78.  
  79.             //countries
  80.             if(country.equals("pl"))
  81.             {
  82.                 factorcountry=1F;
  83.             }
  84.             else if(country.equals("ru"))
  85.             {
  86.                 factorcountry=1.2F;
  87.             }
  88.             else if (country.equals("us"))
  89.             {
  90.                 factorcountry=0.9F;
  91.             }
  92.             else if (country.equals("uk")) {
  93.                 factorcountry = 1.1F;
  94.             }
  95.             //height
  96.             if(false==sex)
  97.             {
  98.                 if (hight<150)
  99.                     factorsexhaight=0.5F;
  100.  
  101.                 else if (hight<170 && hight>150)
  102.                     factorsexhaight= 0.7F;
  103.                 else if (hight>=170)
  104.                     factorsexhaight=1F;
  105.             }
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.             return result;
  116.  
  117.  
  118.         }
  119.  
  120. }
  121.  
  122.