CSSE 120 — Intro. to Software Development

Final C Project — Transcript

Overview

For your final project in CSSE 120, you’ll write a program for Rose transcripts. The program will let the user enter courses and letter grades and will calculate term and cumulative GPAs, along with cumulative credit hours earned. It will display the a transcript with the calculated GPAs and credit hours earned.

Accomplishing the above earns a score of 80%. For each of the following, allowing the user to accomplish the action earns an additional 10% (but with the maximum score capped at 110%).

This is an individual project, but you may work in pairs if you indicated your pair preferences to your instructor. We want everyone to keep practicing their C programming so you do well on the final exam!

Your work for this project should be done in the Transcript project that you can check out from your individual or pair SVN repository.

Sample Input and Output

The main menu should look something like:

1:  Select term
2:  Add a course and letter grade
3:  Display current transcript
4:  Save current transcript to a file
5:  Load a transcript file
9:  Exit

Enter selection:  

Notes:

Pressing 1 on the main menu might display:

Current term is Fall 2010-2011, change selected term to:
1:  Fall 2009-2010
2:  Winter 2009-2010
3:  Spring 2009-2010
4:  Fall 2010-2011
5:  Winter 2010-2011
6:  Spring 2010-2011
7:  Fall 2011-2012
8:  Winter 2011-2012
9:  Spring 2011-2012
10:  Fall 2012-2013
11:  Winter 2012-2013
12:  Spring 2012-2013
13:  Back

Enter selection:

Notes:

Pressing 2 on the main menu might display:

Enter course identifier (example: CSSE120):
Enter course name (example: Intro_to Software_Development):
Enter course grade (example: B+):
Enter course credit hours (example: 4):

Notes:

Pressing 3 on the main menu might display (after entering some courses/grades):

Fall 2009-2010                         Grade CrHrs
CLSK100  College and Life Skills         A     1
CSSE120  Intro to Software Development   B+    4
MA111    Calculus I                      C     5
PH111    Physics I                       D+    4
PH111L   Physics I Lab                   NG    0
RH131    Rhetoric and Composition        A     4
TERM     GPA: 2.78
CUM      GPA: 2.78
CR HRS                                 Total: 18

Winter 2009-2010                       Grade CrHrs
CSSE220  Object-Oriented Software Dvlpm  A     4
MA112    Calculus II                     B+    5
ECE130   Introduction to Logic Design    A     4
PH112    Physics II                      F     4
PH111L   Physics II Lab                  NG    0
TERM     GPA: 2.91
CUM      GPA: 2.84
CR HRS                                 Total: 31

Spring 2009-2010                       Grade CrHrs
(No classes entered)
TERM     GPA: 0.00
CUM      GPA: 2.84
CR HRS                                 Total: 31

   ...

Spring 2012-2013                       Grade CrHrs
CSSE479   Cryptography                   A     4
CSSE499   Senior Project III             A     4
SV245     Mus Hist:Classicl,Romntc,Modrn A     4
TERM      GPA: 4.00
CUM       GPA: 3.14
CR HRS                                 Total: 43

Notes:

Other Requirements

It is not enough to just get the program to work!

A correct solution will demonstrate good decomposition into functions and good use of structures. This will vary depending on how you approach the problem, but a reasonable decomposition would include at least two structures and on the order of 10-35 functions. (Two 110% solutions by two professors had 32 and 19 functions, respectively.)

Your structures should be defined in one or more appropriate .h files.

Grading — 200 Points Total

Basic features (you should get these working first) — 160 points of 200 possible:

  1. (15) The term to be used as the current term can be selected.
  2. (15) The current term is applied appropriately to subsequent course/grade entries.
  3. (15) The course and letter grade information can be entered successfully.
  4. (90) When the transcript is displayed, it:
  5. (10) The code has appropriate documentation (comments).
  6. (15) The code uses appropriate style regarding: variable names, breakdown into functions and structures, indenting, use of white space, and so forth.

Additional features (you choose from these) — 20 additional points for each feature below, but capped at 220 total points (110%):
The user can:

  1. (20) Save the transcript to a file. (You decide the format in which to save the data.)
  2. (20) Load a saved transcript.
  3. (20) Delete an individual course. (This is useful in case the user makes a mistake while entering a course.)
  4. (20) Edit the data of an existing individual course. (Again, to help correct mistakes in data entry.)
  5. (20) Allow course names (and course identifiers if you wish) to contain spaces.

Suggestions — Read and Obey These! You'll be sorry if you don't!

Structures

Your FIRST step for solving this problem should be thinking about what structures you want. A couple of useful structures might be:

typedef struct {
	// elided
} GPA;

typedef struct {
	// elided
} Course;

FYI, two 110% solutions by two professors had 3 and 4 structures, respectively. You choose your own structures (but include at least two structures).

Also at this point think about what arrays you will want.

Procedural decomposition

Your SECOND step for solving this problem should be writing down the calls that main will make to functions that you will (LATER) define.

Stubs

Your third step for solving this problem should probably be writing stubs for the functions that main calls.

Iterative enhancement

This is critical: For the rest of your coding, identify one TEENY additional functionality that seems right to do next. Implement and test. Don't proceed until you get that teeny functionality working.

  • The key is testing as you go. Work through the problem in an order than helps you accomplish that.
  • Gotcha's

    As you have seen, the hard part of C is avoiding mistakes. Once you make a mistake, it is often time-consuming to track down the error.
    So try to avoid these common mistakes:

    1. Abusing scanf.
    2. Abusing printf. Likewise, make sure that printf has exactly as many variables to be set as there are % signs in the format string, and that the types match.
    3. Mixing scanf with other input functions. Don't, unless you know what you are doing. Instead, stick to scanf (and fscanf for reading from a file).
    4. Launching with errors. Never run the program if you see compiler error-messages. If you see:
          Errors exist in a required project.  Continue launch?
      
      always respond No. If you see a little asterisk by the name of the file on the tab in the Editor, that means that file has not been saved. Never run unless it has been saved (for most of you, running asks if you want to save it).
    5. Mysterious compile-time error messages. If you experience this, here are several things to try:
    6. Compiling while running. If you get an error message that is something like:
          mingw32\bin\ld.exe: cannot open output file [SOMETHING HERE].exe: Permission denied
      
      that almost certainly means that you are still running the program in this or another console. To fix this, you often have to use the pull-down menu on the right-hand-side of Console et al windows that says Display Selected Console. Select it, find the running programs and stop them with the usual red boxes. There are often MANY running programs in this situation; you must stop them all.
    7. Missing functions. Suppose you get a compile-time error message like:
      implicit declaration of function 'foo'
      
      or perhaps:
      conflicting types for 'foo'
      
      Any of the following could be the problem:
      1. You misspelled the name of the function, either in the call or the definition of the function.
      2. You called or defined the function with the wrong number or wrong type(s) of arguments.
      3. The function belongs to a library that you failed to #include.
      4. You defined the function BELOW the place in the file where you called it.
        • The C compiler barfs at this because it processes a source file from top to bottom, so when it hits the function call it does not yet know what it needs to know about the function.
        • One way to solve this problem is to move the function definition ABOVE its call(s).
        • Another, perhaps better, way is to put prototypes near the top of the file (before any function definitions), like this:
          double foo(double y[], int size); // Prototype, near the top of the file.
          
             ...
          double foo(double y[], int size) {
             ... // Code for the function here
          }
          
          The prototype is shown in red. It's easy to obtain — just copy the first line of the function definition and replace the curly-brace (and its preceding space, if any) by a semicolon. Its a good habit to make a prototype every time you define a function, because it avoids this problem and provides a handy list of your functions at the top of the file.
    8. Messy code is almost impossible to get correct. Keep things simple and clean. Refactor often to maintain that simplicity and cleanliness.
    9. Waiting to the last minute guarantees failure.
    10. Turn In

      Submit your work by committing it to your individual SVN repository. Commit often since that backs up your work.