Computer Programming

Getting started with Perl

  1. Accessing the Perl Programming Environment.
  2. Editing the Perl source code.
  3. General Perl CLI tutorial - to follow.
  4. IT PLC: this tutorial parallels the barcode assignment.
  5. Using Perl online.

Perl Nuggets:

Perl Tutorials:

Perl Books (All from O'Reilly Books):

Flowchart Tutorials (verrrry important):

Other Tutorials:

General items:

Assessment 2009/10:

  • Written Exam 40%
    • Will be posted afterwards
  • Assignments: (2 @ 30% each = 60%)
  • For each assignment submit:
    1. Standard Cover Sheet
    2. Program Listing (print out)
    3. Flow Chart (should be completed first)
    4. Screen shots of sample program runs etc
    5. Any other appropriate items in support of your assignment
    6. also
      • Submit ...your script electronically... (temporarily postponed)
      • Make ...an oral submission...

  • Assignment #1: POS Program.

Use the link above to view the Perl tutorial pages explaining the skills required for the assignments.

  • (Last updated: 20091209-15:02)
  • Assignment #1 - Barcode Shopping Reader Program with Product Database (POS application)
  • Tutorial trail for Assignment #1
    • The sample data (in plaintext text format) to use in your database file. The program expects this file to be called "barcodes.dat" unless you choose to change it.
    • These are sample barcodes (in PDF format) for testing purpose.
    • Sample output from a program run.
    • A visual demonstration on how to use the barcode scanner:
      • This model of barcode scanner plugs into the PS/2 keyboard port at the rear of the computer. The keyboard then plugs into the scanner. This is known as a keyboard wedge.
      • The scanner it self can have its mode of operation changed by scanning codes from the manual. For example, whether the scanner transmits a CR, an LF or a CR+LF is controlled this way. This influences whether the chop function will be required. Also, the scanner is pre-set by this means to read EAN-13 barcodes.
      • The barcode scanner (typically) uses red light to pick up the barcode from the object and essentially 'types' the code into whatever program is running.
      • This is a typical EAN-13 barcode:
  • Assignment #2: Maze Game. (Almost) identical to the 4th assignment from 2000 and the second assignment from 2008.
  • (Last updated: 20100415-12:26)
    • For an example of how this program might work in actuality, log in to the programming server and change directory to /home/public - within that folder is a pre-compiled binary of a C program that largely does as this years assignment is required to do. The file is called amazing.bin and can be directly executed within that directory using the command ./amazing.bin - your character is the @ symbol. If you have read the brief you'll know the meaning of the other symbols, as well as the purpose of the program.
    • Please use the Term::Screen module for this program.
    • Sample Steps:
      1. 0401.pl ("Hello World" using Term::Screen)
      2. 0402.pl (put a map on the screen quickly: uses file maze04.map)
      3. 0403.pl (control the position of a character on screen)
      4. 0403.pl.txt (doing position checking in the maze)
      5. 0404.pl (faulty!)
      6. 0405a.pl (corrected use of 2D array: uses file maze06.map)

Assessment 2008/9:

  • Written Exam 40%
  • Assignments: (2 @ 30% each = 60%)
  • For each assignment submit:
    1. Standard Cover Sheet
    2. Program Listing (print out)
    3. Flow Chart (should be completed first)
    4. Screen shots of sample program runs etc
    5. Any other appropriate items in support of your assignment
    6. Submit your script by email.

    • Assignment #1, Culloughtys Country Hostel: Reservation Form validation program
      • Reservation form from which to validate input with demonstration script.
      • Read up on checksums!
      • Perl Business::CreditCard module.
      • After a sanity check on the user input data the following criteria to a booking will apply:
        1. No booking for more than 12 people may be made
        2. Bookings may only be made for the following month.
        3. Bookings of children only are not acceptable.
        4. Only VISA credit cards are accepted.
        5. The card holders name should have two or more parts.
        6. The credit card number should be potentially viable.
        7. The card expiry date should be potentially viable.
        8. The completed booking should be stored in the file "/home/public/hosteldatabase2009.dat"
        9. Open the database file in append data (">>") mode.
        10. Save each valid booking record as a series of fields using colons (:) as the delimiter.
        11. Separate each record in the database by an EOL. Therefore each line is a record.
        12. Concatenate all the data fields with the '.' operator
        13. The first field in the booking record should be your username.
      • View the reservations database.
    • Click below to test your form & script combination:
    • The reservation database is now closed to further entries.
    • Assignment #2, Culloughtys Country Hostel: Reservation database manipulation program (Version 89)
      • (Last updated: 20090304-02:38)
      • Write a script that accepts one of a number of input options, as indicated by a radio-button control, and responds appropriately.
      • Provide as many as possible of the features listed below. Start with the easier tasks and build from there. Many of the code elements are re-usable allowing you to create later features from earlier ones.
      • Possible input options/requests include:
        1. Duplication for further processing of the previously stored database ("/home/public/hosteldatabase2009.dat") under a new name for processing
        2. Where possible remove records from the copied database that are obviously incorrect eg:
          1. e.g.
          2. Remove records with empty fields
          3. Remove records with more than 12 people booked
          4. Remove records with invalid dates
          5. ...
        3. Retrieve a booking by name for printing or deleting
        4. Retrieve a booking by email for printing or deleting
        5. Retrieve all of 'todays' bookings
        6. Perform a series of statistical/data processing calculations
      • A program to generate more sample data for processing is here: https://www.fachtnaroe.net/~fachtna/make-data-2009.pl.txt. It may be useful as another perl program sample.
      • ...more may follow...
    • Click below to test your customised form & script combination:
    • Apart from the reservation database from Assignment #1, you may also use /home/public/00-2009-sample-reservations.dat (250 records), /home/public/01-2009-sample-reservations.dat (1000 records), /home/public/comparative.dat (1000 records) and /home/public/00-comparative-2009.dat (250000 records).

Assessment 2007/8:

  • Written Exam 40%
  • Assignments: (2 @ 30% each = 60%)
  • For each assignment submit:
    1. Standard Cover Sheet
    2. Program Listing
    3. Flow Chart (should be completed first)
    4. Screen shots of sample program runs etc
    5. Any other appropriate items in support of your assignment

    • Assignment #1, Option 1: Perl CGI program to verify user input - Tour Booking. Cross reference to Web Authoring
      • After a sanity check on the user input data the following criteria to a booking will apply:
        1. No booking for in excess of the guide figure from the form may be made.
        2. No booking for less than 10 people may be made
        3. Bookings may only be made for the following month.
        4. Bookings of children only are not acceptable.
        5. The completed booking should be stored in the file ">> /home/public/fitzgerald2008.dat"
        6. Write the record of the booking as a series of fields (even if empty) separated by colons (:) as the delimiter
        7. Concatenate all the data with the '.' operator
        8. The first item in the record should be your username.
      • Sample Tour Booking Form with functioning script.
      • View the tour bookings database.
    • Assignment #1, Option 2: - Barcode Shopping Reader Program (Assignment #1 from 2006/7).
    • Assignment #2, Option 1: - Maze Game. (Almost) identical to the 4th assignment from 2000.
      • For an example of how this program might work in actuality, log in to the programming server and change directory to /home/public - within that folder is a pre-compiled binary of a C program that largely does as this years assignment is required to do. The file is called amazing.bin and can be directly executed within that directory using the command ./amazing.bin - your character is the @ symbol. If you have read the brief you'll know the meaning of the other symbols, as well as the purpose of the program.
      • Please use the Term::Screen module for this program.
      • Sample Steps:
        1. 0401.pl ("Hello World" using Term::Screen)
        2. 0402.pl (put a map on the screen quickly: uses file maze04.map)
        3. 0403.pl (control the position of a character on screen)
        4. 0403.pl.txt (doing position checking in the maze)
        5. 0404.pl (faulty!)
        6. 0405a.pl (corrected use of 2D array: uses file maze06.map)
    • Assignment #2, Option 2: - Bomb Defuser Game (FKA 'hangman').

Assessment 2006/7:

This years assessment structure will not vary from that of previous years. However, the language taught is to change again. Once we programmed in a beautiful language called Pascal. Then we changed to C. Now we change again to a 'new' language: Perl (see above).

Use the link above to view the Perl tutorial pages explaining the skills required for the assignments.

Assessment 2005/6:

Assessment 2004/5:

Assessment 2003/4:

Assessment 2002/3:

Assessment 2001/2:

Assessment 2000/1

  • Written Exam 50% (The 2001 exam paper is here).
  • Assignments (4 @ 12.5% each = 50%)
    • Assignment #1 -
    • Assignment #2 -
    • Assignment #3 -
    • Assignment #4 -

Assessment 1999/2000

Assessment 1998/9

  • Written Exam 50% (The 1999 paper is here)

Related:


Last updated: 20100729-07:46