JAVA උදව්වක් ඕනෙ ඉක්මනටම.

hans078

Active member
  • Feb 17, 2008
    496
    179
    43
    Colombo
    JAVA උදව්වක් ඕනෙ ඉක්මනටම.

    මචංලා කාට හරි පුලුවන්ද මේ සමීකරනෙ JAVA වලින් ලියන හැටි කියල දෙන්න. මට ENTER කරන්න තියෙන්නෙ බර(in pounds) විතරයි. විස්තරේ පහල තියනව. ලොකු හෙල්ප් එකක්.

    The Formula is
    Kilocalories per day = K0.75 (BW)

    This means that

    The number of Kilocalories that your animal needs per day = K0.75 multiplied by the Body Weight of the animal in kilograms.

    1 pound = 0.45 kilograms Multiply the number of pounds by 0.45 to get Kilograms​



    Kilocalories per day for a 5 pound mammal = K 0.75 X (5 pounds X 0.45 to convert to Kilograms)

    K 0.75 = මේක මචන් K වල 0.75 බලේ...
     

    suki300me

    Junior member
  • Apr 18, 2008
    350
    20
    18
    Closer than u think, I am
    Hope this helps

    import java.io.*;
    import java.lang.*;

    public class myFirst {

    public static void main (String[] args) {

    System.out.print("Enter weight: ");

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    int weight, cal;
    int K=1; // Enter value for K here

    try {
    weight = br.readLine();
    } catch (IOException ioe) {
    System.out.println("IO error trying to read");
    System.exit(1);
    }

    cal = (Math.pow(K, 0.75)) * weight * 0.45

    System.out.println("Kilocalories per day = , " + cal);

    }

    }
     
    Last edited:
    • Like
    Reactions: hans078

    blackcatcyb

    Active member
  • Jun 9, 2007
    649
    162
    43
    New Zealand
    Hope this helps

    import java.io.*;
    import java.lang.*;

    public class myFirst {

    public static void main (String[] args) {

    System.out.print("Enter weight: ");

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    int weight, cal;
    int K=1; // Enter value for K here

    try {
    weight = br.readLine();
    } catch (IOException ioe) {
    System.out.println("IO error trying to read");
    System.exit(1);
    }

    cal = (Math.pow(K, 0.75)) * weight * 0.45

    System.out.println("Kilocalories per day = , " + userName);

    }

    }

    Oya tiyenne gediya pitinma