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:
1.Flowchart
2.Pseudo-code
3.Program coded
4.Program output
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:
After input has been validated, use the following formula to determine the percentage of calories from fat:
Percentage of calories from fat = (fat grams * 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).
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.