What I would suggest is to use generic lists rather than arrays as the list size is not a fixed value so you avoid the empty array cell value problem. Rather than have multiple if then else
statements in your code you can calculate the results you require. Something along these lines.
private static void Main(string[] args)
{
double creditHoursMin = 1.0;
double creditHoursInc = 0.5;
List<(int higher, int lower, string grade)> ranges = new() {
(100,90,"A"),(89,82,"B+"),(81,74,"B"),
(73,66,"C+"),(65,58,"C"),(57,50,"D"),
(49,0,"F")};
List<(string? grade, double creditHrs)> courseResults = new();
int[] testData = new[] { 10, 55, 60, 70, 76, 84, 92 };
foreach (int score in testData)
{
string? grade = ranges.Where(r => score >= r.lower && score <= r.higher)
.Select(t => t.grade)
.FirstOrDefault();
var index = ranges.Select(r => r.grade).ToList().IndexOf(grade);
var creditHrs = index != -1 ? index * creditHoursInc + creditHoursMin : 0;
courseResults.Add((grade, creditHrs));
}
IEnumerable<string?> courseResultsGrades = courseResults.Select(cr => cr.grade);
Console.WriteLine($"The grades of your courses are : {string.Join(',', courseResultsGrades)} ");
var creditTotal = courseResults.Select(cr => cr.creditHrs).Sum();
Console.WriteLine($"The total number of credit hours is: {creditTotal} ");
Console.ReadLine();
}