Write a program to roll a die by N-times, the number of times (N) should be in the range of 1 to 50 (inclusive)

Write a program (C#) to roll a die by N-times, the number of times (N) should be in the range of 1 to 50 (inclusive). Calculate the number of occurrences in between all the outcomes and create a frequency distribution bar chart as shown in below. The program should display error messages if the value outside the acceptable range is entered or if a non0numeric character is entered.

For an example, a user wishes to roll 18 times of a die, the program should generate a list of 18 random numbers in between 1 and 6: 5 1 3 3 4 1 2 6 5 2 6 6 1 6 4 3 2 2

Number of occurrences

1 ​***

2​ ****

3​ ***

4​ **

5 ​**

6​ ****