Vai al contenuto

Challenge 2012-05

Discussione Text Challenge

Write a program to read in and spell-check a sentence of text from a user.

Hint: Use the Dictionary method as a spell checker to find any miss-spelt words and highlight these for the user.

Musical Challenge

Write a program to play your country’s national anthem.

Community Suggestion Challenge (CodingLikeCrazy)

Write a program that writes up to the first 1000 primes, with user inputting how many primes to show.
If user requests over 1000 an error is displayed.

Graphical Challenge

Make a tower of Hanoi game, for example like this.

Database Challenge

Write a simple database that can read and write data to a file and an interface to edit, add and delete data.
For example an address book with name, address and telephone number for each person in the database.

Physics Challenge

Write a program to calculate the elevation of a canon in degrees to hit a target.
The canon ball discharge velocity is 100 m/s and gravity is 10 m/s/s.

Consider different target distances and find the maximum distance.

If you want more of a challenge:

  1. include air resistance where the cannon ball decelerates so that its speed through the air falls by 5% per second.
  2. include a head wind speed of 5 m/s.

Hint: You could calculate an array of results dist[elevation]=distance and use the Maths Challenge 1 to interpolate the result.

The results array could be calculated by:

  1. Algebra – solving equations (best when the equations are easy, but can get too hard).
  2. Numerical simulation – run repeated time-steps updating vertical and horizontal velocities and distances until the vertical distance returns to zero (the ground).

Maths Challenge 1

Write a program to interpolate an array of data.

The array of data values y[x] is given by the following code:

For x = 0 To 65
  y[x] = Math.ArcTan(x)*x

Without using the formula (just the data array y[x]) write a program to estimate x for any value of y input by a user in the range 0 to 100.

Maths Challenge 2

y = x – x*x*x/3 + x*x*x*x*x/5 – x*x*x*x*x*x*x/7

Write a program to find x for any input y.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.