To the faculty page of James Tam Return to the course web page

CPSC 217: Mini-Assignment 1

Due at 4 PM. For assignment due dates see the main schedule on the course webpage.

New Concepts to be applied for the assignment

Only new concepts that need to be applied in the assignment are listed, concepts previously applied in other assignments may also be needed in the implementation of your solution.

Writing a grade point to letter grade mapping program

Although most mini-assignments are graded on program functionality this assignment will require a specific design in order for credit to be awarded so you learn how to write your programs correctly. Also, some later features will require earlier features are correctly and completely implemented. Sufficient information should be provided below so make sure you pay attention to details.

Feature #1 (Required design of your program): Define named constants for the minimum and maximum valid grade points at 0 and 4.3 respectively (Worth 0.1 GPA). Named constants were covered in the "Intro to programming lectures" but here is an [additional resource] if you need it. In order to get the credit for [Feature #3] the program must use these two named constants as part of the error checking. To illustrate here's an [example] of a named constant ('MIN_AGE') being defined and used in an error checking loop.

Feature #2 (Required design of your program): Define named constants for each of the ["Tam cutoffs"] (used as minimum GPA values for the 12 letter grades e.g. the minimum cutoff for an "D" grade is 0.85, the cutoff for a "D+" grade is 1.15 etc.) used in the calculation of your term letter grade for this course.  (Worth 0.6 GPA). Similar to the previous feature, your program must use these 12 named constants in the mapping of term GPA to letter grade in order to be awarded credit for [Feature #4]. If needed here is one [additional example] that shows how a named constant is used in conjunction with branches.

Feature #3: Getting the term grade point and error checking the input (Worth 0.7 GPA).

The grade calculator will prompt the user for a term grade point (not [individual grade points] and not a percentage because percentages will never be involved in the calculation of your term grade for this class) that is within the range from 0 - 4.3. Included in the user prompt is an indication what is the valid range of inputs (e.g. "Enter term GPA (0- 4.3): ". The program will repeatedly prompt  using a loop until a valid value has been entered. Reminder: min. and max. range determined by the named constants defined in Feature #1. Type checking (e.g. string vs. numeric) is not necessary.

Feature #4: Mapping the term GPA to a term letter grade (Worth 2.4 GPA).

(This is how your actual term letter grade for this course is determined). The program will determine the letter grade based on the term grade point using the cutoffs specified in the administrative section of this course.  Reminder: the branches that map the term GPA to letter grade will use the named constants defined in Feature #2.

The "Tam cutoffs" which are used for 217 students in the determination of their term letter grade  (from the [Intro/admin lecture]).

 

Extra clarification (if needed): your program should be written such that the values specified in the "Tam cutoffs" are used. As you see in the [image showing a run of my solution] and in the above image no matter how close you may be to the boundaries if you haven't met or exceeded the minimum specified in the boundary then you will not be "rounded up". You may find that in some cases that your program may appear to rounding automatically while other times it is not. This is not due to rounding but instead is caused by the inaccuracies of how floating point values store numbers. For instance 2.849999999999 may actually be stored as 2.850001 and map to B (because the branch uses what's actually stored as the cut off not what should have been stored) while 2.84999999 is stored as 2.8399999999 and maps to a B- grade. Because this inaccuracy is a limitation of how floating point numbers (it's not python specific but occurs with floats in other languages) are stored it's not something that you need to have your program handle for this assignment. Recall: normally you should use whole numbers rather than floats whenever possible but that's not an option in this case because normally the term GPA will be calculated and those calculations may often result in a floating point result. In terms of your assignment your program should be written so that rational values can be entered and the branches should correctly map the GPA using the above cut offs. If that's the case and your program produces a wrong mapping for a letter that is caused by the inaccuracies of how floating point values are stored then you won't need to find someway to deal with the weaknesses of floats.

Feature #5: Display the GPA and letter  (Worth 0.2 GPA).

 In order to be awarded for this feature the design requirements (Feature #1 & #2) as well as the prompt (Feature #3) and grade mapping (Feature #4) must all be correctly and completely implemented. (It makes no sense to award credit for displaying incorrect information). The program will display the information in the following format. The term GPA is to be shown with one place of precision using a format specifier, the tab is to be specified by using an escape code.

Format:

<String: Term GPA: ><Numeric term GPA><TAB><String: Term letter: ><Term letter grade based on GPA-letter mapping>

Example:

Term GPA: 3.5 Term letter: B+

Important reminder, the program only prompts for a term GPA: although this program seems to be an informal 'sequel' to the one you wrote for A1 do not combine the previous assignment with mini-A2.

How to do determine 'how you did' on an assignment?

Program functionality (implementing working program features)

  • Test your program: Because the assignment description (along with required features) is posted ahead of time if you test your program thoroughly before submitting the final version then you should get a pretty clear idea of "how you will do".

Non -functional assignment requirements (style and documentation).

Although it won't affect your grade for mini-assignments you should still practice applying good style in your solution as well as writing documentation. It will keep your skills for the full assignments (when you will be graded on these things) and get you used to having good habits.

 

Marking and grading

Collaboration:

Assignments must reflect individual work; group work is not allowed in this class nor can you copy the work of others. Some "do nots" for your solution: don't publically post it, don't email it out, don't show it to other students.  For more detailed information as to what constitutes academic misconduct (i.e., cheating) for this course please read the following [link].

Method of submission:

You are to submit your assignment using D2L [help link]. Make sure that you [check the contents of your submitted files] (e.g., is the file okay or was it corrupted, is it the correct version etc.). It's your responsibility to do this! (Make sure that you submit your assignment with enough time before it comes due for you to do a check). If don't check and there were problems with the submission then you should not expect that you can "learn your lesson" and simply resubmit.

D2L configuration for this course

(Waived for fall 2022), Late submissions for full assignments  when there is no extension granted: Again let (TA in the tutorial that you are officially registered) know if you do submit late. Make sure you give yourself enough time to complete the submission process so you don't get cut off by D2L's deadline (or your submission will be automatically flagged as late by D2L and it will be graded appropriately)..

Submission received:

On time

Hours late : >0 and <=24

Hours late: >24 and <=48

Penalty:

None

-1 GPA

-No credit (not accepted)

General use of pre-created Python libraries:

Unless otherwise told you are to write the code yourself and not use any pre-created functions (or methods). For most assignments the usual acceptable functions include: print(), input() and the 'conversion' functions such as int(), float(), str(). Look at the particular assignment description for a list of other functions/methods that you are allowed to use and still get credit in an assignment submission. If it's not listed then you should assume that you won't be able use the function and still be awarded credit.