✅ COMP123 - Bonus 1
Hello Hello!
This is your first bonus. Read carefully.
PROBLEM
Write a C# console program that:
1 - In the Main() method it reads in a list of integers from the user, separated by commas.
2 - Send the list of integers as a single string to a new method you will create which has a parameter of type string.
3 - Your new method should then calculate and print out the sum and average of the integers in the list. The program should handle the case where the user enters an empty list (i.e., just hits enter without entering any integers). You can give an error message in this case.
EXAMPLE
Input:
1, 2, 3, 4, 5
Output:
Sum: 15 | Average: 3
HINTS
To parse a list of integers from a string, you can use the Split method of the string class to split the string on the comma character, and then int.Parse to parse the individual strings into integers.
To calculate the average of a list of numbers, you can simply divide the sum by the number of elements in the list.
To deliver the code:
Create a free account on GitHub.com;
Create a private repository for your new project (don't make it public);
Commit your code to your new GitHub repository;
Share access to your private repo with me by adding my email aolive24@my.centennialcollege.ca as a collaborator of your repository;
Copy and paste the URL to the GitHub repo in the Bonus folder under eCentennial/Assessments/Assignment/Bonus 1
Due date: Saturday May 27, 2023 @ 11:59pm
Good luck!
Aderson