%@ page language="java" %>
<%@ page import="offutt.gpa" %>
<%
// Original from Adam J Boltz
// Greatly modified by Jeff Offutt
// November 2009, homework 6 in SWE 642
//
// This version uses the Java class gpa.java
//
// If the parameter courseCount is 0, no other data is being sent,
// so draw one blank row.
// A JS function adds additional rows.
// If courseCount is not 0, then draw the first row,
// then perform the calculations, summarize the data, and compute GPA.
//
// Form parameters:
// courseNameX
// courseCreditX
// courseGradeX
// One for each row, where 'X' is the row number.
// How many courses are sent.
// This is a hidden form field that is updated by JS when
// a new course is added.
Integer count = 0;
String courseCount = request.getParameter ("courseCount");
if (courseCount != null)
{ // Convert to integer if not null.
count = Integer.parseInt (request.getParameter ("courseCount"));
}
int defaultHours = 3; // Constant to be easy to change.
%>
Grade Calculator
George Mason University Grade Calculator Calculates the current GPA and the minimum GPA needed in the remaining classes Designed for MS students Fall 2009
Base requirements for an MS degree at GMU
GPA must be at least 3.0
10 courses
No more than 2 Cs allowed
Grading Chart
A+
A
A-
B+
B
B-
C
F
4.0
4.0
3.7
3.33
3.0
2.67
2.0
0.0
<% // If count is 0, then we have no submission.
// Print the blank form (above) and no response.
if (count > 0)
{
%>
Your current GPA is: <%= thegpa.getGpa() %>