CS239 Advanced Programming

James Madison University

Software Requirements Specification

Programming Assignment 4

Digital University, Transcript Application.

Complete UML Diagram of your designed application due Monday March 24 in class.  

Final Program Due by March 31th (Monday).  Hardcopy due on April 1.

Complete Javadocs for your application must be uploaded to your web space on Stu by class time on April 1.  


Introduction

Purpose: This application will produce an application that will process a file of information and produce a transcript report.  

Deadlines

Background

Digital University (home of the Byting Bugs) has asked the CS department to design and implement a registration system as class projects.  Advanced Programming (CS239) is charged with creating the application to produce student transcripts from data coming in from a file.

Existing program components

Your application will be written from scratch.  

Input

Your application will process a file containing the data for the transcript whose name will be passed in as the first command line argument.  This file will have the following format:

RecordType,Rest of stuff for this record type

The record type determines the format for the rest of the incoming data.  All data is comma separated with no spaces.  All records end with a newline character.

Record type Meaning Data Elements
H Header student name<String>,major<String>,date graduated (optional) <String>
D1 Detail test result year<int>,term<int>,course number<String>test type<String>,score<double>,hours<int>
D2 Detail transfer course year<int>,term<int>,school <String>,course number<String>,hours<int>
D3 Detail course year<int>,term<int>,course number<String>,course description <String>,hours<int>,grade<String>

Each input file will represent one student.  See sample1  for an example of two input files.

Output

If the file is present and can be read and all of the data is valid, then the application should display a transcript record for a student as follows.  If there is any problem, the first problem encountered will cause an error message and the application will end.  

The transcript will look like the following (Note: data will be displayed in italics...headers will be displayed in bold...this is to illustrate the types...your actual report will be all in the same font):

Digital University - Transcript Record

StudentName
Major: Major
Graduated: Graduation date (if there is no graduation date, there should not be a line)
<one blank line>
Transcript Detail
<one blank line>
detail lines (see below for details)
<one blank line>
Transcript Summary
<one blank line>
<tab>
Successful hours: earned hours<tab>GPA: GPA (to 2 decimal points)
End of Transcript for StudentName

Output for Transcript Detail

  1. Detail lines will be printed in the order they were in the original file.
  2. A header line will print as follows:
  3. The detail lines will print as follows:

Calculating the GPA

GPA calculation will mirror JMU's GPA calculation.  The only difference is that this application will include a TR grade for transfer courses.  

Earned (Successful) hours - Anything with a D or higher (including TR and CR grades) earns hours and should be counted in the total hours field.  Anything with below a D (F, I, Ws, NC) does not earn hours.  

GPA - Only "graded" hours will contribute to the GPA calculation.  Graded hours include all of the successful hours (except for TR and CR) and F.  All other grades will not contribute to the GPA.

GPA is calculated as for an earlier lab.  (See lab number L0204).

Error Handling

You should do a preprocess of the incoming file.  You should evaluate #1 - 5 first (in order), then for each detail row, go through #s 6 - 10 in order.  The first error should stop the preprocessor and end the program.

The following are potential errors that you may encounter.
  1. If there is no command line argument, display the message "Missing file name".
  2. If there is a command line argument, but the file does not exist, display the message, "File " followed by the name of the file followed by " does not exist.".
  3. If the file exists, but cannot be opened, display the message "File " followed by the name of the file followed by " cannot be opened.".
  4. If the file can be opened, the first row in the file should be a H record type.  If not, display the message "Missing header."
  5. If the file contains a H record type, then you must check each of the following records.  
  6. If the type is not one from the list above, display "Bad row: " followed by the entire row from the file.
  7. If the type is one of the types, you should make sure the row has the correct number of tokens.  If not display the message: "Wrong format: " followed by the entire row from the file.
  8. If the number of tokens is correct, but one of the numeric fields is of the wrong type, display the message: "Invalid numeric values: " followed by the entire row from the file.
  9. If any of the hours are < 0 or > 12 display the message: "Invalid hours: " followed by the entire row from the file.
  10. Finally, if any of the grades from the D3 record are invalid, display the message: "Bad grade: " followed by the entire row from the file.
You may disregard any concern about transfer or test scores not being valid.  If those rows are in the file, we have accepted them for credit.

Additional Program Requirements

  1. Design will be critical to this program.  You must have different classes to represent each of the detail record types and the header row.  The detail records should all be part of the family that has DetailRecord as its super class.  You should turn in the design document during lab and review it with the lab instructor that day.
  2. You must use the DetailRecord as illustrated by the following UML diagram.  You may choose which attributes to include in all records and must include each of the methods shown.  
DetailRecord UML
  1. This will be a "submit" lab.  Programs failing to submit will be docked an automatic 20 points.
  2. Your program must include an acknowledgement section acknowledging help received from TAs or reference sources. You do not need to reference receiving help from the instructor.
  3. If you received no help, your acknowledgement section should have a statement to that effect.
  4. Your program must conform to standard Java programming standards and the additional requirements for this class. See the Style Guide for this class.
  5. Where feasible, you should use prevention to avoid having your program throw exceptions.  In some cases, you must use an exception handler as required by the compiler.  In some cases, you may find that an exception handler will be the best way to handle the exception.  Exception handling should be as specific to the exact problem as possible.  Try blocks that encompass large sections of code will have points deducted.
  6. If you do exception handling, you must catch the exact exception that will be thrown.
  7. Javadocs must be created for this assignment.  Create the Javadocs and upload them to your web space on stu (www directory).  Inside of www place a folder named pa4 (case sensitive).  Put all the files directly into this directory.  I should be able to type in w3stu.cs.jmu.edu/yourName/pa4 and see your complete and correct javadocs.  Make sure that you set the public access to R.  (chmod +or *).

Timesheet

To help give you some idea of how you are spending your project time you will fill out a timesheet.xls, timesheet.pdf, timesheet.ods recording all of the time and the category into which that time goes for every block of time that you spend on the project. (Choose whichever format you prefer.  The pdf version is intended to be filled out by hand while the other two are intended to be electronic records.) While it may be scary to see how many hours you put into a programming project, this will help you to plan better for future projects in the class and others.  When working on custom work, your time might also be billed back directly to the customer necessitating an accurate accounting.  An explanation of the categories:
  1. Design - Any time that you spend thinking through, charting, diagramming, or writing pseudo code is considered design time.  You may have a big chunk of design at the beginning, and then small amounts as you try to work through a particular problem or issue.  
  2. Coding - Any time spent writing code that is new to the project would be coding time.  Don't count the time that you are coding in direct response to an execution error from a test.  Do count as coding any time that you spend coding after doing a design or redesign and before you begin testing the new solution.
  3. Testing - Any time spent in testing the program using data.  This might be unit testing (where you are simply testing a single component) or system testing (where you are testing how well the whole project works.)  
  4. Debugging - This is the time that you spend correcting and retesting problems that you find.  The testing and debugging process might lead you to return to design if a particular component is not working properly.

Honor Code

This work must conform to the JMU Honor Code and the specific requirements of this class. You may have an opportunity to work with your team in class on this assignment but only in the confines of the classroom.  Any other help must come from the professor or the TAs for this class.  See the collaboration policy for further information.

Grading

Hints

Bonus Credit