7.2 Write a Java program called to create an Excel spreadsheet Create a class called Food…

7.2 Write a Java program called to create an Excel
spreadsheet

Create a class called Food to represent a Lunch food item.
Fields include name, calories, carbs
In a main method (of a different class), ask the user “How many
things are you going to eat for lunch?”.
Loop through each food item and prompt the user to enter the
name, calories, and grams of carbs for that food item. Create a
Food object with this data, and store each Food object in an
ArrayList
Create a method called printLunch(), that will take an
ArrayList of Food objects as an argument and create an Excel
spreadsheet. This method should loop through the ArrayList and
write the data to a file called lunch.csv (CSV
stands for Coma Separated Values)
The data should be printed in this format below. Be sure to
include a header as the first line of code written the the file,
and a total row at the end. You will see that every row will be a
new row in the Excel spreadsheet, and every coma will create a new
column.
After collecting all the food data in your main method, pass
the ArrayList to the printLunch () method.  

Hint: To append to a file, check out

Example lunch.csv file (You should be able to
open this file in Excel, but in Notepad it will look just like
this)
Name, Calories, Carbs
Pizza, 1800, 46.3
Salad, 355, 6.4
Soda, 200, 12.1
Total, 2355, 64.8