Question: Write a Java program called to create an Excel spreadsheet of your friends. Ask the user How many friends do you have?. (Note. you should
Write a Java program called to create an Excel spreadsheet of your friends.
Ask the user "How many friends do you have?". (Note. you should enter a small number like 3, not 10000 when testing this program)
Using a loop structure, loop for each friend and prompt the user to enter their name, age and weight. (1 point)
Create a class called Friend, and store each friend in a Friend object (1 point)
Store all the Friend objects you created in an ArrayList (1 point)
Create a method called printFriends(), that will take an ArrayList of Friends objects as an argument (1 point)
After collecting all the friends data, pass the ArrayList to the printFriends() method. This method should loop through the ArrayList and write the data to a file called friends.csv (CSV stands for Coma Separated Values) (1 point)
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. You will see that every row will be a new row in the Excel spreadsheet, and every coma will create a new column. (1 point)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
