Important: The deadline for this event has passed. Solutions are available in VBScript, Windows PowerShell, and Perl. |
In Pool Party, competitors will be asked to read from a database and make some simple calculations based on the data in that database.
Not a native speaker of English? These event instructions are also available in the following languages: Chinese (Simplified); Chinese (Traditional); French; German; Japanese; Portuguese Brazilian; Russian; and Spanish. For more information, and to access these localized instructions, see the Scripting Games International page.
| About This Event | |
| Event Scenario | |
| How to Enter |
Division | Beginner |
Deadline | Monday, March 3, 2008 (8:00 AM PST) |
Points Awarded | 15 |
For this event you’ll have to read from a database (Pool.mdb in the 2008 Scripting Games Competitor’s Pack). This is a Microsoft Access database, but don’t worry, you don’t need to have Access installed on your computer to complete this event.
The Pool.mdb database contains a table named SwimmingPool. This table has eight fields:
| • | ID. The unique identifier for each table. A good database will typically have a unique key for each table, but you won’t need to use this key to complete this event. |
| • | Customer. A string containing the name of the customer who’s having a swimming pool put in. |
| • | Length. The length of the pool, in meters. (All pools are rectangular in shape.) |
| • | Width. The width of the pool, in meters. |
| • | Depth. The depth of the pool, in meters. This value is 0 if the pool is not a uniform depth (that is, if the Slope field is Yes). |
| • | Slope. A Yes/No field indicating whether the pool is a uniform depth (No) or it has a shallow end and a deep end (Yes). For this event, you can assume that the deep end and shallow end are the same size. That is, if a pool is 10m wide by 20m long, the deep end will be 10m wide by 10m long (half the size of the pool), and the shallow end will also be 10m wide by 10m long. |
| • | SStart. The depth at the shallow end of the pool, in meters. |
| • | SEnd. The depth at the deep end of the pool, in meters. |
To successfully complete this event, you need to read from this database and display the name of each customer along with the volume of water that the customer’s swimming pool will hold. Your output should look something (but not exactly) like this:
Name: Jones
Volume of Water: 1000000
Name: Myer
Volume of Water: 1800000
To help you out, here’s how you calculate the volume of water (in liters) in a swimming pool:
| • | Uniform depth: Length x Width x Depth x 1000 |
| • | Slope: Length x Width x ((Deep End Depth + Shallow End Depth) / 2) x 1000 |
After completing the script, click the appropriate link to submit your entry:
| • | |
| • | |
| • |
If the link doesn’t automatically open a pre-addressed message, send email to scripter@microsoft.com (in English, if possible) with the subject line Beginner VBScript: Event 9; Beginner Windows PowerShell: Event 9; or Beginner Perl: Event 9.
All you have to do is paste your code into the body of the message and then send the mail. You may also include the following:
| • | A name or nickname we can use to identify you when posting Scripting Games points leaders. |
| • | The name of the country you would like to represent. This might be your country of birth or the country you currently live in, but it doesn’t have to be; you can represent any country you wish. |
| • | The name of any user group that you belong to. This should be included if your user group is participating in the User Group Challenge. |
You can simply type these items in at the top of the email. In that case, your email (assuming you’re submitting an entry for the VBScript division) might look something like this:
Ken Myer
USA
Northern Iowa User Group
For i = 1 to 100
Wscript.Echo i
Next