Answered step by step
Verified Expert Solution
Question
1 Approved Answer
As a developer for XYZ Food Industries you have been asked to write a Java program named CalorieCounter that is intended to assist a nutritionist
As a developer for XYZ Food Industries you have been asked to write a Java program named CalorieCounter that is intended to assist a nutritionist in processing information about a list of food items and their corresponding calorie counts. Your program is to prompt the user to enter the names of five different food items and the corresponding calorie count for each item. The names are to be of type String and the calorie count is to be of type int. After the data has been entered, the program will then display the following: the sum of the calories of the five items, the average of the total calories of the five items; the item name and calorie count for the item with the highest calorie count: the item name and calorie count for the item with the lowest calorie count, the items and their corresponding calories that exceed the average of the total calories; the items and their corresponding calories that are less than the average of the total calories: the items and their corresponding calories that match the average: Note: all numeric processing is to be performed as an integer, for example, integer division. Note: While this problem specifies five data items, the solution is to be written to accommodate a specified, but potentially large number of data items. Sample Input Data juice 50 bigmac 200 candy 400 milk 500 egg 100 apple 500 Program Output the sum of the calories in the five items is: val che average of the total calories of the five iteme 19: val the item name and calorie count for che item with the highest calorie count: values the item name and calorie count for che item with the lowest calorie count: values che items and their corresponding calories that exceed the average of the total calories: zero or more values che items and their corresponding calories that are less than che average of the total calories: zero or more values the items and their corresponding calories that match the average: zero or more values
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started