Ask Experts Questions for FREE Help !
Ask
    mes2015's Avatar
    mes2015 Posts: 1, Reputation: 1
    New Member
     
    #1

    Mar 6, 2013, 12:51 PM
    Java Program- Help Needed
    How do I write this code?

    You will ask the user for 2 inputs, the total number of chocolate, and the amount of chocolate that goes into the making of the large bar. You must be able to accept decimal point values for both. The small bar value is fixed at 0.5.
    To solve this program, we want you to use loops. This is very important. This assignment is further practice using loops.
    Here is the calculations we want you to do:
    Calculate the number of large bars that can be made from the total amount of chocolate
    From the remainder, calculate how many small bars can be created.
    We do not want partial bars. So if there is chocolate left over, it can be discarded.
    Once you have completed your calculations, you will print out the number of large and small bars that can be made. Please use the formula "From the chocolate given, you get (your # of large bars here) large bars, and (your # of small bars here) small bars."

Check out some similar questions!

Java Program [ 2 Answers ]

1) Code a java class for an Object SONG, that has as a minimum the following attributes:- SONG Title (a String) , SONG Group/artist (a String ), SONG genre (a String – “Pop”, “Jazz”, “Hard Rock” etc. SONG price (double), SONG duration (int number of seconds). Code all accessor and mutator methods...

Postfix program in java [ 0 Answers ]

Java program? [ 2 Answers ]

we have an assignment! but hold up! I would only ask what is the name of this code if I have fill up the blanks! code: puclic class problim{ public static void main(Stringarg){ int x=___; int y=___; while;(__<s){ x=____;

Java program error [ 1 Answers ]

Sir, program is for managing account details using jdbc but ,there error like some variable not accessible in specefic block . Please solve this problem. If you can.. //mypanel1-LogIn class mypanel1 extends JPanel { JTextField t1,t2; JButton b1,b2; mypanel1() { JLabel l1,l2; ...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.