Advertisement
solidsnake

tyyt

May 6th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.39 KB | None | 0 0
  1. namespace MidtermHandsOn
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             Student[] arr = new Student[10];
  8.             string input = "Y";
  9.             int i = 0;
  10.  
  11.             while (!input.Equals("N"))
  12.             {
  13.                 Console.Write("Enter Student Name: ");
  14.                 Student temp = new Student();
  15.                 temp.Name = input;
  16.  
  17.                 Console.Write("Enter Quizzes Grade: ");
  18.                 input = Console.ReadLine();
  19.                 temp.Quiz = int.Parse(input);
  20.  
  21.                 Console.Write("Enter Midterms Grade: ");
  22.                 input = Console.ReadLine();
  23.                 temp.Midterms = int.Parse(input);
  24.  
  25.                 Console.Write("Enter Projects Grade: ");
  26.                 input = Console.ReadLine();
  27.                 temp.Project = int.Parse(input);
  28.  
  29.                 Console.Write("Enter Finals Grade: ");
  30.                 input = Console.ReadLine();
  31.                 temp.Finals = int.Parse(input);
  32.  
  33.                 arr[i] = temp;
  34.                 i++;
  35.  
  36.                 Console.Write("Do you still want to continue [Y/N]?");
  37.                 input = Console.ReadLine();
  38.             }
  39.  
  40.             for (int x = 0; x < i; ++x)
  41.             {
  42.                 Console.WriteLine("{0} \t\t {1}", arr[x].Name, arr[x].LetterGrade);
  43.  
  44.             }
  45.             Console.ReadLine();
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement