Eclipse project help [message #1702529] |
Wed, 22 July 2015 19:14  |
Eclipse User |
|
|
|
I could use some help on this please!
Fat Gram calculator
Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows:
- Make sure the number of fat grams and calories are not less than 0.
- According to nutritional formulats, the number of calories cannot exceed fat grams * 9. Make sure the number of calories entered is not greater than fat grams * 9.
Once correct data has been entered, the program should calculate and display the percentage of calories that come from fat. Use the following formula: Percentage of calories from fat = (Fat grams * 9) / calories.
Some nutritionists classify a food as "low fat" if less than 30 percent of its calories come from fat. If the results of this formula are less than 0.3, the program should display a message indicating the food is low in fat.
Seems I am having issues with the while statement or I have this all wrong. I would truly appreciate some suggestions, troubleshooting steps, and resolution to this problem. Please see file attached.
|
|
|
|
|
|
Re: Eclipse project help [message #1702785 is a reply to message #1702531] |
Fri, 24 July 2015 10:34  |
Eclipse User |
|
|
|
Nitin Dahyabhai wrote on Wed, 22 July 2015 23:19This forum is to help you get Eclipse running. You'll need your fellow students, javaranch.com, or stackoverflow.com for purely Java questions.
You did read that, right?
|
|
|
Powered by
FUDForum. Page generated in 0.08382 seconds