Java Reference
In-Depth Information
A sample input file follows:
3 345
Lisa Miller 890238 Y 4
Mathematics MTH345 4 A
Physics PHY357 3 B
ComputerSci CSC478 3 B
History HIS356 3 A
.
.
.
The first line indicates that 3 students are enrolled and the tuition rate is $345 per credit
hour. Next, the course data for student Lisa Miller is given: Lisa Miller's ID is
890238 , she has paid the tuition, and is taking 4 courses. The course number for the
mathematics class she is taking is MTH345 , the course has 4 credit hours, her mid-
semester grade is A , and so on. The output of the program is of the following form:
Student Name: Lisa Miller
Student ID: 890238
Number of courses enrolled: 4
Course No
Course Name
Credits Grade
CSC478
ComputerSci
3
B
HIS356
History
3
A
MTH345
Mathematics
4
A
PHY357
Physics
3
B
Total number of credit hours: 13
Midsemester GPA: 3.54
1
0
It is clear from this output that the courses must be ordered according to the course
number. To calculate the GPA, we assume that the grade A is equivalent to 4 points,
B is equivalent to 3 points, C is equivalent to 2 points, D is equivalent to 1 point, and
F is equivalent to 0 points.
Input: A file containing the data in the form given previously. For easy reference in
the rest of
the discussion,
let's assume that
the name of
the input
file is
stData.txt .
Output: A file containing the output of the form given previously.
We must first identify the main components of the program. The college or
university has students, and every student takes courses. Thus, the two main compo-
nents are the student and the course.
Let's first describe the component Course .
PROBLEM
ANALYSIS AND
ALGORITHM
DESIGN
Course
Search WWH ::




Custom Search