Lecture notes for the Introduction to Computer Science I by James Tam Return to the course web page

CPSC 231: Assignment 2

Grade out of 16 Letter
16 A
15 A-
14 B+
13 B
12 B-
11 C+
10 C
  9 C-
  8 D+
  7 D
  6 D-
  Below 6 marks F

Part 1: Fixing a non-compilable program (8 marks)

In the Assignment directory (/home/231/assignments/assignment2) you will find a Pascal program in a UNIX text file called "broken.p".  Rename the file to "fixed.p" (1 mark), and change the name of the program (in the program header) to "fixed" (1 mark).   Then make the three edits in the program (2 marks for each edit x 3 edits = 6 marks) so that it will compile.  Aside from making the changes that will allow the program to compile you cannot otherwise change the program (i.e., you can't just simply write your own Pascal program instead of fixing the one that was provided).

New concepts to be applied:

Getting familiar with some of the more common syntax errors that prevent program a program from compiling.  The ultimate goal is to be able to produce a program free of errors.

 

Part 2: Simple text formatting (8 marks)

In the Assignment 3 directory (/home/231/assignments/assignment2) you will find a Pascal program called 'converter.p'.  You are to change this program so that the output matches the output of the executable program called "converter".  What you need to do:

New concepts to be applied:

Formatting output via the field width and precision values for write and writeln.

 

Submission requirements

In addition to having fulfill the generic assignment requirements, the requirements specific to this assignment include:

 
  1. Include a README file in your submission:  For this assignment you need to include a file called 'README' which includes your contact information: your name, university identification number and UNIX login name so that your marker knows whose assignment that he or she is marking.  Also it should list the features of the assignment that have been implemented in your program.

 
  1. The programming assignments require a two part submission: a) A paper submission of your README file and Pascal program into the assignment drop boxes (second floor Math Sciences) b) An electronic submission (again of your README file and your Pascal program) as an email attachment (don't cut and paste it into the email body!) to the following people (failing to include everyone listed below may result in your assignment not being marked for credit so before submitting your assignment double check!) Make sure that the subject line of the email contains the exact text (don't add or delete anything to it or you will lose marks - mail filters work by looking for specific words in the subject line): CPSC 231 Assignment X. Both parts are necessary. Electronically submitting the assignment allows your marker to compile and run the code in order to quickly determine what features were implemented.  Providing a paper printout makes it easier for your marker to read and flip through your source code.  A typescript of your execution is not needed for the programming assignments (this assignment onwards).

X = The appropriate assignment number (e.g., for Assignment 2 the subject would be titled "CPSC 231 Assignment 2")

 
  1. The course instructor at the following email address: tamj@cpsc.ucalgary.ca
 
  1. Your tutorial instructor, the email addresses for the TA's can be found on the main course web page.
 
  1. Yourself. Sending the assignment to yourself provides one last "double check" that you submitted your assignment properly (e.g., you sent it to all the right people, you attached all the important files to the submission etc...you should actually open the file attachments and check the files rather than just looking at the email). When you receive the submitted assignment you can check one last time to make sure that you fulfilled all the requirements. If you forgot something then you can resend your assignment with a note to mark only the latest submission (but try not to resubmit your assignment too many times please).
 
  1. As a reminder, you are not allowed to work in groups for this class: assignments must be completed and submitted individually.
To help make sure that you haven't missed anything here is a checklist of items to be used in marking.