Question: This exercise requires designing a Java software program which solves the problem described in the problem statement below. Please provide comments as necessary. Your solution

This exercise requires designing a Java software program which solves the problem described in the problem statement below. Please provide comments as necessary.
Your solution (identification headers) must include the following:
Flowchart - MUST BE DONE USING FLOWGORITHM APP!!!!
Pseudo-code
Program coded
Program output
Problem Statement
Design a program that asks for the number of fat grams and calories in a food item to determine the percentage of calories from fat. Validate input as follows:
The number of fat grams must be at least 0.
The number of calories must be at least 0.
The number of calories cannot be less than fat grams *9.
After input has been validated, use the following formula to determine the percentage of calories from fat:
Percentage of calories from fat =(fatgrams*9)/calories.
Your program should consist of the following:
Module main. Calls getFat, getCalories, and showPercent.
Function getFat.Accepts user input of fat grams.Validate user input as a non-negative number and return valid fat grams.
Function getCalories.Accepts user input of total calories. Validate user input as a number that is non-negative and greater than or equal to (fat grams *9). Return a valid number of calories.
Module showPercent.Displays percent of fat in the food item, determined by this formula: (fat grams *9)/ calories. Displays a message indicating the food item is "low fat" if the percentage of fat is less than 30%(0.3).
Expected Output
Your output should be similar to the following:
Please enter the number of fat grams: 20
Please enter the number of calories: 100
The number of calories cannot be less than the number of fat grams *9.
Please enter the number of calories. 200
The percentage of calories from fat is 80.0 percent.
Please enter the number of fat grams: -1
The number of fat grams cannot be less than 0.
Please enter the number of fat grams. 10
Please enter the number of calories. 350
The percentage of calories from fat is 25.7.
That food item is considered "low fat".

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!