User Tools

Site Tools


programming_tasks

This is an old revision of the document!


A Wiki dedicated to creating neat programming tasks

1. VBA - Access Database uses a form that allows filtering of a student list based on a substring typed in search field. Eg. 'Sa' shows only surnames starting with Sa on the fly as the letters are typed. To be posted soon.

2. Actionscript 3.0 - a simple paddleball game that randomly creates targets on screen as well as the starting position of the ball. Upon hitting the paddle the speed of the ball increases as well as the paddle width decreasing by a set proportion of the original width. Some respite is allowed when the score reaches a multiple of 5, by slowing down the ball and increasing the paddle width slightly. Rename zip to fla exension paddleball-3.zip.

3. Round any decimal number UP to the next highest multiple of 0.25.

4. Convert any Roman number to decimal (e.g. MCMLXIX to 1969) - and/or vice versa

5. Convert any binary number to decimal.

6. Find the lowest (or greatest) common denominator of 2 integers (or report that there is no LCD or GCD).

7. List prime numbers up to 100

8. Simulate the display of a single-digit liquid crystal display Assume there are 7 LCD bars like this _

_
_

Feed it any numeral or alphabetic character in hexadecimal range (0 to F) and it should turn on the right bars. (Efficiency is the key requirement here!)

9. Create an algorithm to play naughts and crosses - it should be unbeatable if the algorithm plays first.

10.Given an number of dollars, calculate what notes or coins need to be given as change from $100. e.g. $67 = 1 x $20, 1 x $10, 1 x $2, 1 x $1.

11. An electrical company is developing a new main-powered sensorlight with the following requirements: • It turns on its LED light for a predetermined time (e.g. 60 seconds) after sensing movement with its passive infrared (PIR) detector. • It does not turn the light on if its light detector senses that the room is already well illuminated (e.g. during the day) • While its light is on, any further movement detection resets the timer back to its starting value and the countdown starts again. Convert your algorithm into a working simulation of the light. You will need to simulate: • The day/night sensor (e.g. with radio buttons) • The movement sensor (e.g. with a mouse click or keypress) • The LED light (e.g. with a shape changing its colour) Show the value of the countdown time onscreen to verify its behaviour.

12. Stuff Pty Ltd sells stuff. The unit cost of the stuff varies according to the quantity ordered. Customers can order any number of items. Stuff Pty Ltd use this scale:

1-9 items = $100 each 10-19 items = $97 each 20-29 items = $92 each 30-39 items = $88 each 40-49 items = $85 each 50 or more = $82 each

Task: using pseudocode, create an algorithm to calculate the unit cost of the items at different quantities. Then calculate a total cost with 10% GST added. Convert the pseudocode into code.

programming_tasks.1305029873.txt.gz · Last modified: 2011/05/10 12:17 by kel