To Projects

IT 230 -- Project 5
GradeBook

  1. Create an ASP.Net page (.aspx extension) that displays grade data from university students:
     
    1. Display grade data that is stored in the comma delimited file grade-data.csv.
       
    2. This file includes the fields ID, LastName, FirstName, CourseNumber, CourseName, CreditHours, Grade.
       
    3. Include textboxes for the user to enter the LastName and FirstName and a submit button for submitting the query. The corresponding course numbers, course names, credit hours and grades should be concatenated and displayed as a long string in a literal control.
       
    4. The GPA of the selected student should also be displayed. The GPA is computed as the total of (credit hours * grade points) divided by the total credit hours. Grade points are defined as A=4, B=3, C=2, D=1, F=0.
       
      For example, suppose that a student has taken the following classes:
       
      Course Credit Hours Grade Grade Points
      Course 1 4 B 3
      Course 2 3 A 4
      Course 3 2 C 2
      Course 4 4 A 4

      Therefore, GPA = (4*3 + 3*4 + 2*2 + 4*4) / (4 + 3 + 2 + 4) = 44 / 13 = 3.39.
       
    5. Here is suggested pseudocode for the button event handler:
      public void btnSubmit_Click(object sender, EventArgs e)
      {
          Declare variables, initialize totalCreditHours and 
              totalGradePoints each to 0.0.
          Initialize litDisplay with headings.
          while(sr.Peek( ) > -1)
          {
              Read line.
              Use Split method to obtain array of fields.
              Obtain lastName, firstName, courseNumber, courseName, 
                  creditHours, and grade from fields array.  
              (Use double.Parse to convert credit hours.)
              if (first name from textbox matches first name from file &&
                  last name from textbox matches last name from file)
              {
                  Update totalCreditHours.
                  if (grade == A)
                  {
                      Update totalGradePoints.
                  }
                  else if (grade == B)
                  {
                      Update totalGradePoints.
                  }
                  ... continue with else if statements for C, D, and F.
      
                  litDisplay += string.Format( ... format string ...,
                      courseNumber, courseName, creditHours, grade);
      
              }
              Close input file.
          }
          Compute GPA.
          Display GPA in textbox.
      }