Vai al contenuto

Challenge 2013-06

Curriculum Challenge 1.5

  1. Write a program that asks the user for 2 numbers and what calculation to perform (+, -, / or *), then uses a different subroutine to do the required calculation.
  2. Get the user to enter a word and use the Dictionary method to get its definition.
    Create a subroutine to check if it can be used as a noun, and if it is, use a second subroutine to get and print the first noun definition.

Small Challenge 1

Write a program that outputs a multiplication table, using an input multiplier and maximum to multiply it by.

For example multiplier 7 and maximum 12.

  • 1 x 7 = 7
  • 2 x 7 = 14
  • 11 x 7 = 77
  • 12 * 7 = 84

Small Challenge 2

It is useful to be able quickly do approximate maths in your head.
To help, write a program that shows approximate (to the nearest integer) divisors of 100.

For example:

  • 100/7 ~ 14
  • 100/17 ~ 6

Maths Challenge

Write a program to calculate the area of regular polygons (equal side lengths and equal internal angles).
The first is an equilateral triangle, the second a square, etc.
The user enters the number of sides and their length.

For large number of sides, the area should approximate that of a circle.

Game Challenge

Write a repro of the Tron game, Google for it, here is a simple scratch version.

Physics Challenge

Calculate the time for a satellite to orbit the Earth at different altitudes.
What altitude is a geostationary orbit (orbits in 24 hours).

G*M*m/r/r = m*v*v/r

  • G is gravitational constant  6.67384 E-11 m3 kg-1 s-2
  • M is the Earth mass 5.972 E24 kg
  • m is the satellite mass (orbit doesn’t depend on this)
  • v is the satellite velocity (m/s)
  • r is the satellite distance from the Earth center

The Earth radius is 6371 km

Community Challenge 1

(By Nonki)

  1. Write ASCII code table.
  2. Make any kind of roulette (wheel).

Community Challenge 2

(By Jibba Jabba)

When people register on a theatre website, the email address is used as the login name and the user is requested to enter a password to use with the account.

A user’s details include: email address, password, first name, surname and address.
These are stored in a csv file.

When a user logs in, they enter their email address and must enter their password before accessing their account details.

Code a program which:

  • asks for an email address and password
  • searches the file for the email address
  • if the password is correct it displays the customer details
  • it displays a suitable error message if the password is incorrect.

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.