AssignmentOne

Task 1: Build your own C# Console App - Sales Analysis Application

  1. Introduction: You have been assigned a project to develop a Sales Analysis Application using C#. The application will help a company analyze its sales data to identify trends and make informed business decisions. Your task is to implement the core functionalities of the application using C# arrays, loops, methods, and conditional statements.
  2. Case Study: The company sells various products and maintains sales data for each product. The sales data consists of the product ID, quantity sold, and the sales amount. The company wants to analyze this data to determine the total sales for each product, the highest-selling product, and the average sales per product. Your task is to design and develop a C# console application that allows the company to input sales data and analyze it. The program should include the following functionalities:
  3. Tasks
  4. Input Sales Data: o The program should prompt the user to enter the number of sales records to be entered. o Using a loop, the program should ask the user to input the product ID, quantity sold, and sales amount for each record. o Store the entered data in appropriate arrays.
  5. Calculate Total Sales: o Implement a method that calculates and returns the total sales for each product. This method should take the sales amount array as a parameter and return an array of total sales.
  6. Identify Highest-Selling Product: o Implement a method that determines and returns the product ID of the highest�selling product. This method should take the total sales array as a parameter and return the product ID with the highest sales.
  7. Calculate Average Sales: o Implement a method that calculates and returns the average sales per product. This method should take the total sales array as a parameter and return the average sales value.
  8. Display Results: o Display the total sales for each product. o Display the product ID of the highest-selling product. o Display the average sales per product.
  9. Implement appropriate validation checks for user input. For example, ensure that the product ID, quantity sold, and sales amount values are valid.
  10. Write comments to explain your code wherever necessary.
  11. Test the program thoroughly to ensure that all features work correctly