Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.57 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Text.RegularExpressions;
  4.  
  5. class mainClass
  6. {
  7.     static void Main()
  8.     {
  9.    
  10.     //loop statement here that changes gradeTextLine[1] to [3],[5], [7] each time around etc.
  11.     {
  12.    
  13.    
  14.    
  15.         Console.WriteLine("0    10   20   30   40   50   60   70   80   90  100");             
  16.         Console.WriteLine("|    |    |    |    |    |    |    |    |    |    |");
  17.         Console.WriteLine("***************************************************");
  18.        
  19.         string gradeText = File.ReadAllText("grades_multiple.txt");
  20.        
  21.         string[] gradeTextLine = Regex.Split(gradeText, "\r\n");
  22.        
  23.        
  24.         double countA = 0;
  25.         foreach (char a in gradeTextLine[1])
  26.         {
  27.         if (a == 'A')
  28.         {
  29.         countA++;
  30.         Console.Write("*");
  31.         }
  32.         }
  33.         Console.Write(" A\n");
  34.        
  35.         double countB = 0;
  36.         foreach (char b in gradeTextLine[1])
  37.         {
  38.         if (b == 'B')
  39.         {
  40.         countB++;
  41.         Console.Write("*");
  42.         }
  43.         }
  44.         Console.Write(" B\n");
  45.        
  46.         double countC = 0;
  47.         foreach (char c in gradeTextLine[1])
  48.         {
  49.         if (c == 'C')
  50.         {
  51.         countC++;
  52.         Console.Write("*");
  53.         }
  54.         }
  55.         Console.Write(" C\n");
  56.        
  57.         double countD = 0;
  58.         foreach (char d in gradeTextLine[1])
  59.         {
  60.         if (d == 'D')
  61.         {
  62.         countD++;
  63.         Console.Write("*");
  64.         }
  65.         }
  66.         Console.Write(" D\n");
  67.        
  68.         double countE = 0;
  69.         foreach (char e in gradeTextLine[1])
  70.         {
  71.         if (e == 'E')
  72.         {
  73.         countE++;
  74.         Console.Write("*");
  75.         }
  76.         }
  77.         Console.Write(" E\n");
  78.        
  79.         double countF = 0;
  80.         foreach (char f in gradeTextLine[1])
  81.         {
  82.         if (f == 'F')
  83.         {
  84.         countF++;
  85.         Console.Write("*");
  86.         }
  87.         }
  88.         Console.Write(" F\n");
  89.        
  90.     }
  91.    
  92.    
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement