Question: i need this in java not c++ or python please if you can include steps and explanation im confused File I/O Make sure to show
i need this in java not c++ or python please if you can include steps and explanation im confused


File I/O Make sure to show your mycandy file, your source code, and your program output (10 pts) Part 1 make a comma separated file Create a simple text file called mycandy The first line of the file will be Candy Name, Candy Calories, Total Fat Grams Almond Joy, 250, 9 Snickers, 240, 4 Next, add five lines to the file by hand using your favorite five candy bars information. Each line's data will be separated by commas. (70 pts) Part 2 read in the file and make a list of candy objects Create a class called Candy which keeps track of the three pieces of information Read in the file line by line and create a Candy class instance for each candy bar you have, and add that new instance to a list. Once you have the list created (its easiest to use an ArrayList) , loop through the list and print the candy bar info out to the console Hints: look at my ListofObjects google doc Hints: look at StringSplit google doc Hints: look at my FilelO google doc(s) and watch the File IO lecture(s) as needed Hints: I HAVE AN ALREADY CODED EXAMPLE WHICH IS NEAR EXACT/VERY CLOSE TO THE SOLUTION,YOU NEED TO LOOK IN Filelocsv in the class notes for this, it will make the assignment much easier! (20 pts) Part 3 append a line to the file When you want to append to a file your second argument to the file writer is usually "true" which is to say, if the file exists, you want to append to it. Add a line of code to append one more candy bar's information to your mycandy file. Show what your new text file looks like after the append Hints: look at my FilelO google docs and find the file append example, and watch the File IO lecture Hints" don't forget to open the file for append, add a new Candy bars info, then close the file. Don't forget to indicate in your source code where you do this. References Refer to my class notes on File IO https://zetcode.com/java/appendfile/ https://www.programiz.com/java-programming/examples/append-text-existing-file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
