C M S C     1 1 4
C o m p u t e r   S c i e n c e   I
S p r i n g   2 0 0 4


Project #0

Due Friday, February 6th, by 8AM

Preliminary Material

Project 0 is worth 1% of your grade.

As with all projects it is extremely important to begin early. While completing this project, in addition to having a C++ reference (like the CMSC 114 text) handy, you should review the tutorials posted on the main class webpage - even if you are already familiar with UNIX it would be wise to review those tutorials as well.

There are generally a number of details contained in a project description such as this one. Please note that failure to follow the details outlined in the project description could result in a substantial loss of points so it is very important to pay close attention to the project description.

Purpose

The goals of this project are to:

  1. Set up and become familiar with your UNIX class account (on the dc.umd.edu network).
  2. Review some basics from CMSC 106 (input/output, functions) and "brush off the dust" - by writing, compiling, testing and submitting a short program (described below).

Academic Integrity Statement and Acceptable Use Guidelines

Please note that all programming projects in this course (including this one) are to be done independently or with the assistance of the instructional staff of this course only.

Please review the policies outlined on the class syllabus and below concerning the use of class computer accounts (Acceptable Use Guidelines) and concerning the University's Code of Academic Integrity. The instructors of this course will review all of the programs submitted by students for potential violations of the Code of Academic Integrity and if it is believed that a violation has occurred it will be referred to the Office of Judicial Programs and the Student Honor Council.

Note that "hardcoding" is also considered a violation of academic integrity.

If you are unclear about any of the policies of this course you should ask either of the instructors for further clarification. NOTE: unless explicitly specified otherwise these policies apply to all assignments in this course:

Code of Academic Integrity
Guidelines for Acceptable Use of Computing Resources

Programming Style

All your programs in this course should be written in ANSI C++, which means they must compile and run correctly with ``cxx -w0 -std strict_ansi'' on the OIT UNIX Class Cluster (dc.umd.edu). Note that on future projects you will be restricted to using only those features found in specific chapters of the CMSC 114 textbook (for example chapters 1-6) or covered in class.

Your program must have a comment near the top which contains your name, login ID, your section number, your TA's name, an estimated time it took to complete the project (in hours) and an original description of the action and operation of the program (thus at least 6 items neatly organized and easy to read).

Your program should be written using good programming style and formatting, as discussed in class and throughout your textbook. For this project, style is considered to consist of:

FAQ

Answers to "frequently asked questions" will be posted via the main projects page. Prior to asking a question or submitting a project you should check the FAQ to see if any important information has been covered there. In addition to answers to FAQ's, any important information pertaining to a project will be posted on it's FAQ.

Email and Office Hours

Note that email regarding project questions will go unanswered and the means for obtaining assistance on a project is through office hours. See the course syllabus for additional information regarding these policies.

Project Overview

------
PART I - Logging in, setting up, and using your account
------

Note - Even if you are familiar with Unix, if you do not follow these instructions as listed it may result in your being unable to complete PART II of this assignment (and result in a loss of points on this project and possibly future projects).

Log in to your class account using ssh, putty, or some other similar remote-login program (use telnet as a last resort). You should log in (connect) to the hostname dc.umd.edu and use your class login id (jm114xxx or fe114xxx) and the password given. Note that if you ever have trouble logging into dc.umd.edu you can also try the following five addresses:

holmes.umd.edu   marlowe.umd.edu   marple.umd.edu   tracy.umd.edu   wolfe.umd.edu

Once you successfully log in a number of screens of information will appear. Continue to press 'q' (Q for quit) until you get to the UNIX prompt (% ).

At the UNIX prompt run the dce_login command to "authenticate" your login session (this is only needed when running the setup program and/or changing your password) - be sure to use your class login ID (as the "Principle Name") and then your password. [If you use telnet the system will generally not let you complete the dce_login process - log out, log into your wam account and then "ssh" to your class account and it should then work]

After authenticating your session run the following command:

    ~fe114001/setup      or     ~jm114001/setup

depending upon which section you are in (your login ID is a hint).

After running the setup program you should change your password (passwd) and then your finger information (chfn) - note that failure to change your finger information may result in loss of points on this and future projects - you should at least modify your finger information so that it reflects your real name (other information you may leave blank). Do not put your nickname down for your finger information - it should be your first and last name. Note: it may take up to 24 hours for your finger information to take effect - that is normal.

Now log out and log back in and then your account will be successfully set up and you should see the current class announcments displayed when you log in. NOTE: to log out you will need to type exit and then give the logout command (logout) - you only need to do this (type exit) this time because of the "authentication" that the dce_login command did.

After logging back in you should practice using your account a little to become familiar with the computer system. Do NOT forget to log out when you are all done.

NOTE: the setup program "installed" various things and if you fail to run the setup program then you will not be able to submit your projects. Also the setup program modified cxx to automatically use the options -std strict_ansi and -w0 (by aliasing the command). So, at the unix prompt if you wish to compile a file you just need to type cxx and then the name of the file and it will automatically include the required options.

------
PART II - writing a GPA calculator
------

For this part of the project you are required to write a program that will read an "unofficial transcript" and output what the overall GPA for the courses taken would be. The program you write can (and probably should) consist of several functions all of which must appear in the same file (which you will eventually turn in - aka submit).

When writing this project you are encouraged to use cin and cout, however you will be allowed to use printf and scanf (to do so you must #include cstdlib and not stdlib.h). Note that this will be permitted for this project only and on future projects you will be required to use cin and cout for standard input and output.

It is strongly recommended that you create a new directory in your account (name it P0 or something like that) and complete the project in that directory (or a sub-directory of that one). Also you should remember to backup your file(s) on a periodic basis.

------
THE INPUT - an "unofficial transcript"
------

The input to your program will be plain text consisting of an "unofficial transcript" - this input will be redirected at the UNIX prompt into your program. Your program will NOT prompt the user for this input - instead it will assume the input is "automatically" going to be entered and will be in the correct format (described below). So for example, if there is an "unofficial transcript" in the file named sampleTrans.txt then you would run your program (assuming it is named a.out) as follows:

%  a.out  < sampleTrans.txt

Your program then would read (from standard input using cin or scanf) the data entered and produce the expected output (described below) to the computer screen and then end.

One or more sample transcripts is available in the posting account and you are encouraged to look at them when reviewing the following description of their format.

The input will contain a list of the semesters enrolled in school and the courses and grades earned in each of those semesters.

  1. The first line of each semester will appear as a 2-digit number followed by a dash and then an integer >= 0 - for example:
    01 - 4
    Note that the first number (01 in this case) represents which semester this is (the first semester in this case) and the second number represents the number of classes taken this semester (4 in this case). Semesters will always appear in "increasing" order (meaning semester 01 will appear before 02, ...).

  2. Immediately following the first line of each semester, the classes taken by the student will appear - one per line with no blank lines in between. The number of classes (and lines) will match exactly the second number found on the first line of the semester. After all of the classes are listed there will be one single blank line and then the next semester.
    • Each class will appear on a single line of its own and will consist of four capital letters followed by a 3-digit integer followed by a float >= 0.00 followed by a single capital letter - for example:
      CMSC 102 3.00 A
      Note that the float represents the number of credits the course is worth (3.00 in this case) and the single capital letter represents the grade earned for the course (A in this case).

  3. The last semester input will always contain the first line of:
    99 - 0
    and will not contain any classes - this is merely to signify the end of input (also you could read until EOF is encountered as well, but you can assume this last semester of 99 - 0 will always appear immediately before the EOF).
------
THE OUTPUT - the cummulative GPA (and a little more)
------

After reading in all of the input, your program should output the following information (and this is the ONLY output your program should produce - the numbers of course will vary):

Credits Attempted: 12.00
Credits Earned   : 9.00
Cumulative GPA   : 4.000
In exactly this format with the number of credits attempted printed out to two decimal places, the number of credits earned printed out to two decimal places and the cumulative GPA printed out to 3 decimal places. In this example above the credits attempted totaled 12 credits, the credits earned 9 credits and the cumulative GPA was 4.0 (note that this is one of many possible valid outputs).

Note that credits attempted is always going to be equal to the sum of all of the credits found in the "unofficial transcript" - regardless of what the grade earned for each course was.

Note that credits earned is the sum of those credits attempted where the grade earned for the course was A, B, C, D or P.

The cumulative gpa is calculated using the standard method used by the University of Maryland for calculating gpa's with the one exception that "freshman forgiveness" is not applied (meaning your program should not apply this rule). Note that a grade of A is worth 4 "quality points" (qp's), a grade of B is worth 3 qp's, a C is worth 2 qp's, D is worth 1 qp's, F is worth 0 qp's and all other grades and their credits are NOT used in the computation of the cumulative GPA. [If you are uncertain how a GPA gets calculated there will be a FAQ posted describing how it is calculated for the sample input]

Sample I/O

For this project you will be provided with a primary.input and primary.output file. Both of these files can be found in the posting account in the appropriate directory. In order to pass the MRC (minimum running criteria) for this project your program must generate the primary.output when tested with the primary.input as follows:

%  cxx  proj0.cpp
%  a.out  < primary.input  > my.output
%  diff  -bwi  primary.output  my.output
%

The first line (cxx proj0.cpp) is the step to compile the project - note that you should strive to have NO COMPILER WARNINGS (points may be deducted on future projects, not this one, for having compiler warnings). ALSO NOTE: that -w0 and -std strict_ansi do not have to be done when compiling IF YOU HAVE RUN THE SETUP PROGRAM (from Part I of this project) - to see if this has been setup properly type the command alias at the UNIX prompt and if you see a line with cxx cxx -strict_ansi -w0 on it then things have been setup properly.

The second line (a.out < prima...) is a way to run the a.out program and redirect input (<) to come from the primary.input file (instead of the keyboard) and have the output redirected (>) to the file my.output (instead of the screen).

The third and final line (diff -bwi ...) is how we will test to make sure that your output (my.output) matches the expected output (primary.output). The diff command will print to the screen any lines in your file that do NOT match with the corresponding lines in the other file - if nothing gets displayed that is good news - it means that your output matches the expected output. The -bwi options tell the diff command to ignore case (be case-insensitive) and to ignore extra blank spaces. You should strive to have your output diff with the primary.output without the -bwi options, as that forces you to have a "more perfect" match - however when grading we will always use the -bwi option.

Hints

See the FAQ.

How to Submit

For this project you must submit only one single file - the file which contains the source code that completes Part II (the GPA calculator) of this project. You can name this file anything you want, but it must compile using the cxx compiler on the class cluster as specified above.

To turn in a single file in this class you use the submit program/command and provide it with the name of the file (and only one file) that you wish to submit and then the project number you are submitting. For example:

%  submit  proj0.cpp  0

NOTE: you should make a backup copy of all of your work on a regular basis. We will not grant extensions due to mistakenly deleted files or individual computer troubles.

The submit command will generally display information to the screen and you should read that information to make sure your project submits successfully - if you do not see a message stating that your project was submitted then you should assume that it did not get submitted.

If you encounter any difficulties you should attempt to see someone during office hours as soon as possible. We will not accept projects in any other way and they must be submitted using the submit program.

You may submit a project more than once - note however that only the last file you submit will be used for grading purposes - meaning that if you submit twice ontime and then once two days late only the last submission will be graded (the two day late version in this case). See the course syllabus for other details regarding late submissions.


See the class syllabus for policies concerning email
Last Modified: Thu Jan 29 13:04:27 EST 2004
left up down right home

Web Accessibility