Ideas for Programs
Suggestions for programs for practising various facilities of the Pascal language are tabulated below. Most can be used to incorporate procedures, functions and validation. The table is intended to give you ideas for programs. Please let us know if you have ideas of your own that work out well. See the following page for many other suggestions with links to further details and solutions on the DelphiForFun website.
|Program Type||Examples||Pascal facilities practised|
Pounds to kilos
|Readln, writeln, assignment, arithmetic operators +, -, /, *, DIV and MOD|
Score out of 10 for ten random additions
|Random numbers, arithmetic operators, if statements, case statement (for menu)|
|Money selection||Calculate minimum number of notes and coins (£20, £10, £5, £2 and £1) to make up an amount supplied by the user.||Integer division: DIV and MOD.|
|Random numbers, arrays, case statements|
|Card game||Pontoon, snap, knockout whist||Random numbers, arrays of records, loops|
|Video game||Platform, first person shooter
|Routines in WinGraph, SDL or Smart Pascal canvas|
|Game with restriction||Limited units e.g. graphics using only the Crt unit
|Routines in the Crt unit|
|Other game||Hangman, noughts and crosses (tic tac toe), snakes and ladders, rock-paper-scissors, Risk, battleships
|Arrays, selection, iteration|
Find the nth prime number. Find the nth palindrome number. Find prime numbers that are also palindrome numbers.
Convert a denary number supplied by the user to a Roman numeral. (Choose an upper limit for the number according to ability and time available).
See also our tabulated links to integer problems on the DelphiForFun website.
|Nested loops, DIV, MOD, ReverseString|
|String handling (using StrUtils)||
Adding an even parity bit to a 7-bit string
|String as array of char, LeftStr, RightStr, MidStr, Pos, StrToInt, IntToStr, Delete|
|Database||Club membership, stock control for a small business, music collections, data for the common elements||Files, arrays of records, searching, sorting, string grids and many other components|
|Educational||Map-related, calculations, Computing
|Many routines probably using WinGraph or SDL|
|Visual effect||MovingBallWithParticles, BlendingEllipses, MultiDraw
|Routines in WinGraph or SDL|
|Encryption and hiding messages||Examples of encryption on this website include Peter Hearnshaw's Encrypt, a demonstration and using MMX for encryption. For a variety of encryption methods see Cipher Tools. Alternatively, you may want to try hiding a message in a picture.
Your school might like to enter the next annual University of Southampton National Cipher Challenge.
|Files, arrays, selection, iteration, Chr, Ord, in-line assembler, MMX|
|Maths problem||Our Links page describes Project Euler, which is an excellent place to start looking for problems and solutions.||Many facilities including nested loops|
You can download the marking schemes too. The instruction to award a score of zero if a student gets a negative number of marks on any question suggests that the questions are not all that easy!
|Many facilities including nested loops|
|Assorted challenges||Many tutorials include suggestions for challenging tasks. For example, you can follow these links to the Experimenting sections for recursion, validating a postcode, linked lists, queues, sorting and searching, in-line assembler and inheritance.||Many facilities including recursion, string manipulation routines|