We have provided a range of problems of varying difficulty: we expect that very few teams will be able to complete all, or even most of the tasks. Do not be discouraged if you don't get many of them done. There is no pass mark, and points are given to indicate our estimates of their relative difficulty. Even solving one problem is an achievement.
The computer you will use should by now contain a directory UNSWPC98 in which you will find separate directories OpenA, OpenB, and so on to OpenF, and JnrA to JnrD. (If they haven't been installed, copy and unzip the file UNSWPC98.ZIP found on your supervisor's competition disk). These directories contain test files with which to exercise your programs. In particular, files of the form Test1.dat, Test2.dat store input data for the program you will write. To establish how well your program works you need to print a copy of the program output for each of these files. Your supervisor will also ask you at the end of the time period to print program listings for each task at least partially completed.
Because you have to share a single computer you may that find the best strategy is to work on two or three tasks simultaneously (one or two people on each task). The programs should be clearly written and neatly formatted. Do not worry about fancy user interaction: all input will come from a test file. The printed copy of each test run can either be a printed text file or a screen dump.
Good luck. No doubt you will find the competition challenging, but hopefully also rewarding.
| Junior Section | Open Section | |||
|---|---|---|---|---|
| Task | Title | Title | Points (basic) | Points (max) |
| A | Odd Sums | Barcode Validation | 5 | 8 |
| B | PIN Security | Matching Suffixes | 8 | 12 |
| C | Chessboard Generator | Pascal's Triangle | 12 | 12 |
| D | Word Length | Integer Substrings | 8 | 15 |
| E | (Not applicable) | Square Root Calculator | 10 | 10 |
| F | (Not applicable) | Rotation Cipher | 15 | 15 |
There are no points score or extensions for tasks in the Junior Section. Certificates will be issued based on the number of tasks successfully completed. Some of the tasks in the Open Section have extensions, so a range of points is possible.
Write a program that produces a table containing numbers printed in three columns and several rows.
1 1 1 2 3 4 3 5 ? 4 7 ? 5 9 ? 6 11 ? 7 13 ? . . . |
Try to make the program as general as possible: accept PINs of any length up to, say, 20 digits; accept any number of PINs and process each one as you read it. If this is too ambitious, then at least get your program to read one 4-digit PIN and display its code.
| Input | Output |
|---|---|
1234 909090 11111 7920 0 |
1234 = 8765 909090 = 090909 55555 = 44444 7920 = 2079 |
| Input | Output | Input | Output | |
|---|---|---|---|---|
8 * |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
6 # . |
.#.#.#.#.#.# #.#.#.#.#.#. .#.#.#.#.#.# #.#.#.#.#.#. .#.#.#.#.#.# #.#.#.#.#.#. |
| Input | Output | Input | Output | Input | Output | ||
|---|---|---|---|---|---|---|---|
3 + - |
-+- +-+ -+- |
2 1 0 |
01 10 |
1 X 0 |
0 |
If there are two or more words with maximum length on the line, display only the first such word.
| Input | Output |
|---|---|
The Emperor's New Clothes Cinderella three blind mice see how they run |
Emperor's Cinderella three they |