CGS3460 Fall 2004
Assignment 6
(Database Programming)

Due on: December 1, 2004.
Total points: 135 out of 100

Email your program file as attachments to cgs3460@cs.fsu.edu. Subject of the email should be Assignment 6.

 

Objective: - Develop a Students Grade System.

Description: 

The program should be able to read from a data file named student.dat, which keeps all the records of the students' names and grades. These data should then be stored in arrays of Name and Grade. The declaration of arrays of Name and Grade can be as follows:
Student Name as string - CHARACTER*20 NAME(60)
Student Grade as integer - INTEGER GRADE(60)
When the user quits the system, all the current student data should be stored in a new file named newstudent.dat.

The student data file can be organized in the following way, with the first record specifying the total number of records.
5
Tom        85
Amy        78
Lee         90
Linda       88
Dan         95

User interface:

--------------------------------------------------------------------------------
Welcome to the Student Grade System!

Please enter an option number:

1. Input a student's Grade
2. Modify a student's Grade
3. Search for a student's Grade
4. Display the student's Grade and Name in ascending order of student's Grade
5. Display the student's Grade and Name in ascending order of student's Name
6. Display the student's Grade and Name using symbol grade, like 'A', 'B', 'C', 'D', 'F'
7. Display the Grade and Name of the student(s) with the highest grade.
8. Display the Average grade.
0. Quit the System

-------------------------------------------------------------------------------- 


The subroutines and functions should include (but are not limited to):

1. INSERT(SNAME, SGRADE, NAME, GRADE, SNUM)
INSERT is a subroutine to insert a student's name and grade to the grade system. SNAME is the student's name and SGRADE is the student's grade. SNUM is the number of student grades inputted so far. The INSERT subroutine will check if the string SNAME already exists in the string array NAME. If no, the subroutine will insert the name and grade to the arrays and print out "Successfully insert a student's grade." Otherwise the subroutine will print out error message "The student name already exists."

2. MODIFY(SNAME, SGRADE, NAME, GRADE, SNUM)
The MODIFY subroutine will check if the string SNAME in the string array NAME. If yes, the grade of this student is changed to be SGRADE and print out "Successfully change student's grade." Otherwise, print out error message.

3. INTEGER SEARCH(SNAME, NAME, GRADE, SNUM)
This function will search for the NAME array for the string SNAME. If the name is founded, return the student's grade; else return -1.


4. ORDERG(NAME, GRADE, SNUM)
This subroutine will print out the student's grade in ascending order of student's Grade.

5. ORDERN(NAME, GRADE, SNUM)
This subroutine will print out the student's grade in ascending order of student's Name.

6. INTEGER SYMGRADE(SGRADE)
This function will return the symbol grade according to the value of SGRADE. Th policy is: 
90+         A
80~89     B
70~79     C
60~69     D
0~59       F

7. REAL AVERAGE(GRADE, SNUM)
This function will return the average of all the students.

8. BEST(NAME, GRADE, SNUM)
This subroutine will print out the students with the highest grade.

The arguments in the above subroutines and functions are not required. You can have more arguments, or less, depending upon your implementation.

The program's file name should be gradeSystem. If you write your functions and subroutines in (an)other file(s), name the file students.f if they all are in the same file. Otherwise, name each file with the subprogramname.f.

Send your programs and data files of student (if needed)  to cgs3460@cs.fsu.edu when you are ready.

For the subject field of this email, type in: Assignment 6.


Back to Main Page

© 2002 FSU Dept. of Computer Science