Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Text.RegularExpressions;
- class mainClass
- {
- static void Main()
- {
- //loop statement here that changes gradeTextLine[1] to [3],[5], [7] each time around etc.
- {
- Console.WriteLine("0 10 20 30 40 50 60 70 80 90 100");
- Console.WriteLine("| | | | | | | | | | |");
- Console.WriteLine("***************************************************");
- string gradeText = File.ReadAllText("grades_multiple.txt");
- string[] gradeTextLine = Regex.Split(gradeText, "\r\n");
- double countA = 0;
- foreach (char a in gradeTextLine[1])
- {
- if (a == 'A')
- {
- countA++;
- Console.Write("*");
- }
- }
- Console.Write(" A\n");
- double countB = 0;
- foreach (char b in gradeTextLine[1])
- {
- if (b == 'B')
- {
- countB++;
- Console.Write("*");
- }
- }
- Console.Write(" B\n");
- double countC = 0;
- foreach (char c in gradeTextLine[1])
- {
- if (c == 'C')
- {
- countC++;
- Console.Write("*");
- }
- }
- Console.Write(" C\n");
- double countD = 0;
- foreach (char d in gradeTextLine[1])
- {
- if (d == 'D')
- {
- countD++;
- Console.Write("*");
- }
- }
- Console.Write(" D\n");
- double countE = 0;
- foreach (char e in gradeTextLine[1])
- {
- if (e == 'E')
- {
- countE++;
- Console.Write("*");
- }
- }
- Console.Write(" E\n");
- double countF = 0;
- foreach (char f in gradeTextLine[1])
- {
- if (f == 'F')
- {
- countF++;
- Console.Write("*");
- }
- }
- Console.Write(" F\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement