Question
Create a new Console Application project (C#, .NET Core) called In your Program class, create a new method called GetInfo. This method receives one parameter:
Create a new Console Application project (C#, .NET Core) called
In your Program class, create a new method called GetInfo. This method receives one parameter: A string list that is expected to contain a number of sentences. It returns a string that contains a metadata report on the specified list of strings. The report should include: the average number of characters (Hint: spaces are characters), the average number of words, and the longest word found in the entire list. Each one of these should appear in an individual line in the report. You are expected to use a list in this question. Hint: Averages should be calculated across all elements in the list. For example, if the first sentence has 10 characters, and the second sentence has 20 characters, the average number of characters is 15. Once you are done, write the test harness in the Main method of your Program class, ensuring your code is fully functional as per requirements. In other words, define random sentences in your Main method, and display a corresponding report in the Console. The number of items in this list is defined by the last digit of your student number, times 2. For example, if your student number ends with 1, your list should have size 2. If your student number ends with 2, your list should have size 4. If your student number is 0, your list should have size 10. You can choose your sentences freely. For full marks, ensure your method handles exceptions properly, and in case of errors, display clean and meaningful messages to the user (Hint: Implement try-catch blocks).
Hide hint for Question 1 | |
Make sure you completely adhere to all requirements. Do not change anything in terms of behavior, property names, method names, identifiers, etc. You are expected to follow all C# naming conventions. Penalties apply if these guidelines are not followed. COPY THE ENTIRE CONTENT OF YOUR PROGRAM.CS FILE AND PASTE IT IN THE ANSWER BOX FOR THIS QUESTION. Incomplete code will be graded ZERO marks. |
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