possible solutions - computer olympiad

35
COMPUTER APPLICATIONS OLYMPIAD 2016 POSSIBLE SOLUTIONS Contributors: Dr Pam Miller; Ms Fotiene Avrakotos; Charles Smith; Peter Davidson; Keith Gibson; Mike Chiles

Upload: others

Post on 10-Nov-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

COMPUTER

APPLICATIONS

OLYMPIAD

2016

POSSIBLE

SOLUTIONS

Contributors: Dr Pam Miller; Ms Fotiene Avrakotos;

Charles Smith; Peter Davidson; Keith Gibson; Mike Chiles

2

A: WORD-PROCESSING

The Department of Water Affairs & Sanitation branch office in Jamestown runs its own in-house magazine.

The editor has asked you to check the “Eight Ways.doc” article for specific issues before placing it in the

magazine.

1. What does the World Economic Forum rank as the greatest threat to economies

and peace? A two-word answer is expected. water insecurity

Method 1:

Use Word’s search function to search for “World Economic Forum”. This sequence of words only occurs

once in the document, namely the sentence “The World Economic Forum already ranks water insecurity

as the greatest threat to economies and peace.” The answer to the question, viz. “water insecurity” is

given in the sentence.

Method 2:

Use Word’s search function to search for any of the words “World”, “Economic”, “Forum” or “threat”. A

navigation pane, such as the one using the words “World” and “threat” shown below, opens to the left of

the document.

Click on the match that has the correct sequence of words in the sample shown, i.e. “World Economic

Forum”. This will take you directly to that part of the document. This sequence of words only occurs

once in the document, namely the sentence “The World Economic Forum already ranks water insecurity

as the greatest threat to economies and peace.” The answer to the question is given in the sentence.

Method 3:

Treat the document as you would a comprehension test in a language class. Read slowly through the

document until you find the words “World Economic Forum” towards the end of the first full page of text.

This sequence of words only occurs once in the document, namely the sentence “The World Economic

Forum already ranks water insecurity as the greatest threat to economies and peace.” The answer to

the question is given in the sentence.

3

2. Most word processor programs have a spell checker which picks up ‘incorrectly

spelt’ words. The spell checker also sometimes mistakenly picks up proper nouns

(e.g. names which begin with a capital letter including a person’s name). Identify

three words in the article which are NOT proper nouns and which are

DEFINITELY spelt incorrectly. Paste/type the shortest of these three words as

incorrectly spelt on your Answer Sheet).

polution

Method 1:

Scan the whole document for all occurrences of words that are underlined with a red squiggle, such as

those shown below:

Some of the words are proper nouns, i.e. they are names and begin with a capital letter, such as

“Dhesigen”, “Kusile”, “EnergyStar” and “Medupi”. Others are incorrectly spelt words, such as

“renewible”, “goverment” and “polution”. Of the incorrectly spelt words that are not names the word

“polution” is the shortest being 8 characters long. The other incorrectly spelt words are 9 characters

long.

Method 2:

With the document open and the cursor preferably at the beginning of the document select the “Spelling

& Grammar” icon in the “Proofing” section on the “Review” tab in the ribbon. The following window

opens:

Misspelt words and grammatical errors will appear in red in the upper part of the window with some

suggestions as to the correct spelling/grammar appearing in the lower part of the window. In this case

select the “Ignore Once” option and the next misspelt word/grammatical error will be highlighted. Work

your way through the document identifying which of the misspelt words satisfies the criteria and is the

shortest misspelt word. Once again you should note that “polution” is the shortest misspelt word.

4

3. Who is the author of the “Eight Ways.doc” file? CAO

Method 1:

Open the document. Click on the “File” tab in the ribbon.

A window providing detailed information on the file will open. One of the bits of information provided is

the author of the document.

Method 2:

With the document closed right click on the name of the file in Windows Explorer and select

“Properties”, the last item in the drop-down menu that opens. A new window opens such as that shown

on the next page.

Now click on the “Details” tab in this window.

5

One of the items listed is the author or authors of the document (highlighted in blue), in this case “CAO”

6

4. Articles for inclusion in the in-house magazine need to be of a specific

length. How many characters (including white spaces) are there in this article? 15 389

Method 1:

With the document open click on the “Review” tab in the ribbon.

Then click on “Word Count” icon in the “Proofing” section.

A small window opens providing information on the number

of words, lines, paragraphs and characters in the

document.

The number of characters (with spaces) is indicated.

Method 2:

Open the document. Click the "Words" entry in the Status Bar at the bottom of the Word document. This

will also display the Word Count window as shown in the second image in Method 1.

7

5. What is the width of the spacing between the 2 columns under the heading ‘5.

Enforcement’? 1.4

Method 1:

Click anywhere in the column area of the document. Now click on the “Page Layout” tab in the ribbon. In

the “Page Setup” section, click on “Columns” and then choose “More Columns”. A window showing the

current properties of the columns is displayed. The spacing between the columns can be found in this

window.

Method 2:

Click anywhere in the column area of the document. Turn on the

reveal formatting feature of Word by pressing <Shift>-<F1>. A

window opens on the right-hand side of the screen showing the

properties of this part of the document. One of the properties, the

“Col #1 spacing”, shows that the spacing is 1.4 cm.

8

6. What is the exact width of the image of the women trying to put out the fire on the

last page? 11.22 cm

Method 1:

Left-click anywhere on the image. A “Picture Tools” tab will open in the ribbon. Select “Format” in this

tab. The size of the picture will be given in the “Size” section to the right of the ribbon.

Method 2:

Right-click anywhere on the image. An options menu will appear in a window. A small window providing

some detail on the size of the image also appears. The width of the image is contained in this smaller

window.

9

Method 3:

Right-click anywhere on the image. An options menu such as that shown below will open.

Then select the “Size and Position” option. Another window will open, such as that shown below. Select

the “Size” tab in this window. This now clearly shows the horizontal and vertical size of the image.

10

7. In the writing of this report the author consulted a number of individuals, books,

magazine articles and websites. These sources were captured as part of the

document. What is the name of the website on which the article by Prof Bob

Scholes appears?

Health24

Method 1:

With the document open click the “References” tab in the ribbon. In the “Citations & Bibliography”

section click on “Manage Sources”. A window, such as that shown below, will open.

The “Master List” to the left of the window contains all the sources in this and other documents that have

been captured.

The “Current List” section to the right of the window contains only the sources applicable to this

document. In this list you will note that there are two entries containing the name “Bob Scholes”. If you

click on the first entry containing the name “Bob Scholes” you will notice that in the preview pane at the

bottom of the window it refers to a book published by the Wits University Press. If you click on the

second entry containing the name “Bob Scholes” you will note in the preview pane that it refers to a

website and gives the URL of this website. The name of the website is also given, where it says

“Retrieved from Health24”.

Method 2:

With the document open click the “References” tab in the ribbon. In the “Citations & Bibliography”

section click on “Manage Sources”. A window, such as that shown below, will open.

11

The “Master List” to the left of the window contains all the sources in this and other documents that have

been captured.

The “Current List” section to the right of the window contains only the sources applicable to this

document. In this list you will note that there are two entries containing the name “Bob Scholes”.

Highlight the second entry by left-clicking on the entry. Then click on the <Edit> button between the two

windows. The following window opens:

This window contains the name of the website, in this case Health24.

12

B: SPREADSHEET

The Department of Water Affairs & Sanitation runs a call centre to answer questions about our dams.

Some of the questions are definitely asked to catch out the call centre staff. All the difficult questions about

dams and reservoirs are passed to you, Use the spreadsheet “Register” to answer the following questions.

Many of the questions can be answered using the “Filter” function built into Excel. So turn on the filters by:

Highlighting the first row of the spreadsheet, i.e. the row containing the column headings (left click

while the mouse pointer is on the row number); and

Selecting the “Filter” option that appears when you click on the “Sort & Filter” button in the “Editing”

section of the ribbon.

The column headings will now all have a drop-down arrowhead that can be used to sort and filter the data

in the spreadsheet.

The filters can be switched off by repeating the instructions in the 2nd bullet.

1. How many unique ‘WM codes’ refer to reservoirs in the Western Cape province? 6

Method 1 (uses filters):

Turn on filters as explained at the beginning of this section. Using the down arrowhead next to

“Province” in column H select only the rows that contain the words “Western Cape” by deselecting

“(Select All)” and selecting “Western Cape”.

13

Then click on the down arrowhead next to the “WM Code” in column B as shown below.

A window such as the one highlighted below opens. Here you will note that there are 6 unique WM

codes, viz. 3, 4, 5, 7, 8 and 9.

Method 2 (uses SUM and COUNTIF functions):

A much more complicated method using the SUM and COUNTIF functions and a named range can also

be used.

Using the filter functionality sort the worksheet into descending order according to province, this

is so that the Western Cape records are at the top of the worksheet..

Name the range of values B2:B1360 (the WM Codes), e.g. Wcape. This range contains all the

WM codes for the Western Cape.

In an unused cell in column P, say cell P3, type the following formula

=SUM(1/COUNTIF(Wcape,Wcape))

Do not press <Enter> but press <Ctrl>-<Shift>-<Enter>. This indicates to Excel that you are using

an array function. The function in the formula bar will now be enclosed in {} brackets, i.e.

{=SUM(1/COUNTIF(Wcape,Wcape))}

The answer 6 will be displayed in cell P3. This is the number of unique WM codes in the

14

Western Cape.

Method 3 (uses SUMPRODUCT and COUNTIF functions):

A method similar to that used in method 2 but using the SUMPRODUCT and COUNTIF functions and a

named range can also be used.

Using the filter functionality sort the worksheet into descending order according to province.

Name the range of values B2:B1360 (the WM Codes), e.g. Wcape.

In an unused cell in column P, say cell P3, type the following formula

=SUMPRODUCT((Wcape <> "")/COUNTIF(Wcape, Wcape & ""))

In this case press <Enter>

The answer 6 will be given in cell P3. This is the number of unique WM codes in the Western

Cape.

Method 4:

The data could be sorted using a custom sort with the name of the province sorted in descending order

the WM codes sorted in ascending order. The resulting data can then be scanned to see how many

unique WM codes are linked to the Western Cape.

Method 5:

Turn on filters as explained at the beginning of this section. Using the down arrowhead next to

“Province” in column H select only the rows that contain the words “Western Cape” by deselecting

“(Select All)” and selecting “Western Cape”.

Copy the values that appear in column B

(WM Codes) to say column A in a new

worksheet. Click on any cell in this column.

Click on the “Data” tab in the ribbon and

then on the “Remove Duplicates” icon in the

“Data Tools” section. The whole column will

be automatically highlighted and a window

such as that shown to the right will open:

Now click on “OK” and all duplicates in the column will be removed leaving you with a list of 6 unique

values (see image below).

15

2. Give the number of reservoirs that are on the Tradouw River or one of its

tributaries 6

Method 1 (uses filters):

Turn on filters as explained at the beginning of this section. Using the down arrowhead next to “River or

Watercourse” in column I select only the rows that contain the words “Tradouw” using the custom text

filter as shown below:

After clicking <OK> a list of 6 reservoirs (dams) are shown, all of which lie on the Tradouw River or one

of its tributaries.

Method 2 (uses COUNTIF function):

In an unused cell in column P, say cell P4 enter the following formula:

. =COUNTIF(I2:I4598, "*Tradouw*")

Note the following:

the wildcard characters on either side of the word “Tradouw”.

The data extends from row 2 down to row 4598

After pressing <Enter> the value 6 appears in cell P4.

Method 3 (uses a pivot table):

A pivot table can also be used with the “River or

Watercourse” as the row labels and the “Name of dam” as

the values to be counted (see image to the right).

This will produce a pivot table which when filtered for

“River or Watercourse” containing “Tradouw” will yield the

result shown at the top of the next page, showing that

there are 6 dams on the Tradouw River or one of its

tributaries.

16

Row Labels Count of Name of dam

Tradouw River 2

Tradouw River Tr 1

Tradouw River Tr. 2

Wa-Drif, Tradouw River Trb. 1

Grand Total 6

3. How many ‘Drainage Areas’ have an “A1” or a “1B” in the code? 131

Method 1 (uses filters):

Turn on filters as explained at the beginning of this section. Using the down arrowhead next to “Drainage

Area” in column C select only the rows that contain the characters “A1” or “1B” using the custom text

filter as shown below:

Note the following:

The “Or” operator is selected

There are two sets of criteria, one looking for cells that contain the characters “A1” (the top

criterion) and the other looking for cells that contain the characters “1B” (the lower criterion).

When <OK> is pressed a filtered list containing the details of 131 dams is shown. These 131 dams have

an “A1” or a “1B” somewhere in their drainage area code.

Method 2 (uses the COUNTIF function):

In an unused cell in column P, say cell P5, enter the following formula noting the wildcard characters on

either side of the characters “A1”.

=COUNTIF(C2:C4598; "*A1*")

After pressing <Enter> the value 2 appears in cell P5. This represents the number of dams that have the

characters “A1” somewhere in their drainage area code.

In cell P6 enter the following formula noting the wildcard characters on either side of the characters “1B”.

=COUNTIF(C2:C4598; "*1B*")

17

After pressing <Enter> the value 129 appears in cell P6. This represents the number of dams that have

the characters “1B” somewhere in their drainage area code.

These two values together give an answer of 131 which is the number of dams that have an “A1” or a

“1B” somewhere in their drainage area code.

Method 3 (another use of the COUNTIF function):

The actions in method 2 can be combined into a single action using one of the following formulae:

=COUNTIF(C2:C4598; "*A1*") + COUNTIF(C2:C4598; "*1B*")

=SUM(COUNTIF(C2:C4598; "*A1*"), COUNTIF(C2:C4598; "*1B*"))

4. What is the average capacity (in 1000 m³) of the reservoirs which have any type of

“arch” in the wall structure? 94 404

Method 1 (uses filters):

Turn on filters as explained at the beginning of this section. Using the down arrowhead next to “Wall

type” in column J select only the rows that contain the words “arch” using the custom text filter as shown

below:

This filtering will produce a list of 145 dams with the word “arch” in their wall structure. Now highlight all

of the values in column M (the dam’s capacity) in the filtered list and read off the average 94404 in the

status bar at the bottom of the worksheet:

Method 2 (uses the SUMIF and COUNTIF functions):

The average of a set of values can be found by dividing the sum of the values by the number of values.

One can, therefore, us Excel’s SUMIF and COUNTIF functions in a formula.

In an unused cell in column P, say cell P7, enter the following formula noting the wildcard characters on

either side of the word “arch”.

=SUMIF(J2:J4598; "*arch*"; M2:M4598)/ COUNTIF(J2:J4598; "*arch*")

18

After pressing <Enter> the value 94404 appears in cell P7. This represents the average capacity of all

those dams in the list that have any type of arch in their wall structure.

Method 3 (uses the AVERAGEIF function):

There is a slightly shorter method that makes use of Excel’s AVERAGEIF function.

In an unused cell in column P, say cell P7, enter the following formula noting the wildcard characters on

either side of the word “arch”.

=AVERAGEIF(J2:J4598; "*arch*"; M2:M4598)

After pressing <Enter> the value 94404 appears in cell P7. This represents the average capacity of all

those dams in the list that have any type of arch in their wall structure.

5. How many reservoirs were registered on the 29th of February (of any year)? You

MUST show your working in column Q 1

Method 1 (uses the Find operation):

Use Excel’s find function on column O (Registration Date) to find all occurrences of “*/02/29”. This find

function indicates that there is only one date, viz. 1988/02/29, that meets the criteria (see image below).

Method 2 (uses date, logical and COUNTIF functions):

This solution requires a multi-step solution using the date in column O. First identify the day and month

in each date in the column using the DAY and MONTH functions. Then if the DAY is 29 and the MONTH

is 2 insert the word TRUE in the corresponding cell in say column R. Having done this for all rows from 2

to 4598 count the number of occurrences of the word TRUE in column R.

Place the following formula in cell R2 and copy it down to the other cells in the column:

=AND(DAY(O2)=29, MONTH(O2)=2)

In cell R4600 insert the following formula to count the number of occurrences of the word “TRUE”:

=COUNTIF(R2:R4598, "TRUE")

The answer 1 will be shown when <Enter> is pressed.

19

Method 3 (uses text functions):

Another approach would be to convert the date into a text format using the TEXT function and then to

use the MID and RIGHT text functions to isolate the month and day. Combine these two values into a

single string using either the CONCATENATE or & functions and then use the COUNTIF function to

determine how many occurrences of the characters “2902” occur.

Place the following formula in cell R2 and copy this down to the other cells in the column:

=TEXT(O2, "yyyy/mm/dd")

In cell S2 use the following formula, and then copy this down to the other cells in the column:

=RIGHT(R2, 2) & MID(R2, 6, 2)

In cell S4600 insert the following formula to count the number of occurrences of the word “2902”:

=COUNTIF(S2:S4598, "2902")

The answer 1 will be shown when <Enter> is pressed.

Method 4 (uses text and COUNTIF functions:

Another approach would be to convert the date into a text format using the TEXT function. The TEXT

function can also automatically change the formatting. Note that the original date format was

“yyyy/mm/dd” and the use of the TEXT function below changes the format to “ddmm”.

Place the following formula in cell R2 and copy this down to the other cells in the column:

=TEXT(O2, "ddmm")

The above formula automatically converts the date to text in the format given. In cell R4600 insert the

following formula to count the number of occurrences of the word “2902”:

=COUNTIF(R2:R4598, "2902")

The answer 1 will be shown when <Enter> is pressed.

6. The “wall area” can be calculated (very roughly) by multiplying the wall height by

the crest length. What is the greatest value for “wall area” in the list of reservoirs?

You MUST show your working in column U.

490 000

Method 1:

The easiest solution would be to determine the product of the “Wall height” (Column K) and the “Crest

length” (Column L) – place this product in column U. Then use the MAX function to find the largest

value.

Place the following formula in cell U2 and copy down to the other cells in the column:

=K2*L2 OR =PRODUCT(K2, L2)

Place the following formula in cell U4600:

=MAX(U2:U4598)

20

The answer 490000 will be displayed.

Method 2:

Another solution would be to determine the product of the “Wall height” (Column K) and the “Crest

length” (Column L) – place this product in column U. Then sort all the values in descending order. The

answer will then be the value at the top of the list.

Place the following formula in cell U2 and copy down to the other cells in the column:

=K2*L2 OR =PRODUCT(K2, L2)

Then sort all the values in the range A2:U4598 in descending order according to column U. The answer

of 490000 will be found in cell U2

7. Which town has the most dams around it? This town will be listed as the nearest

town for the most reservoirs. Ceres

Method 1 (the very long time-consuming method):

Sort all the values according to column F (Nearest Town). For each town listed, count the number of

times it occurs keeping record only of the town with the largest number of dames. Eventually you will

note that Ceres, with 164 entries, is the town with the largest number of dams around it.

Method 2 (uses INDEX and MATCH):

Copy column F (Nearest Town) to a new worksheet. Sort this list in alphabetical order. Use the “Remove

Duplicates” function found in the “Data Tools” section of the “Data” tab on the ribbon. This will remove all

duplicate entries leaving you with a list of the names of the towns in alphabetical order.

Assuming that the list of names of the towns is in Sheet1 and that the first town “Aberdeen” is in cell A2

enter the following formula in cell B2 and copy it down to all the other cells in the column:

=COUNTIF(Register!$F$2:$F$4598; A2)

The above formula will count the number of times each town appears in the “Register” worksheet. This is

equivalent to the number of dams around each town.

To find the answer to the question one can

EITHER

Scan the list of names looking for the town with the largest number of dams around it (i.e. 164). The list

is 581 rows long. If however, the list had been 5810 rows long this approach would be very time-

consuming so a shorter, more efficient method needs to be found.

OR

Sort the list in descending order according to the number of dams. Ceres, the town with the largest

number of dams around it will be at the top of the list.

OR

Use a combination of functions, especially if the list is a long list. For example one can use the MAX

21

function to determine this maximum value. Enter the following formula in in cell D2:

=MAX(B4:B585)

After pressing <Enter> a value of 164 will be displayed.

Unfortunately VLOOKUP does not allow one to search for a value other than for a value in the first

column. Ideally what we would now want to do is to search the second column for the value 164 and

read off the corresponding value in the first column. The following formula when entered into cell D3 will

solve the problem:

=INDEX($A$2:$A$585, MATCH(D2, $B$2:$B$585, 0))

This method also gives Ceres as the answer.

Method 3 (using a VLOOKUP):

Copy column F (Nearest Town) to a new worksheet. Sort this list in alphabetical order. Use the “Remove

Duplicates” function found in the “Data Tools” section of the “Data” tab on the ribbon. This will remove all

duplicate entries leaving you with a list of the names of the towns in alphabetical order.

Assuming that the list of names of the towns is in Sheet1 and that the first town “Aberdeen” is in cell B2

enter the following formula in cell A2 and copy it down to all the other cells in the column:

=COUNTIF(Register!$F$2:$F$4598; B2)

The above formula will count the number of times each town appears in the “Register” worksheet. This is

equivalent to the number of dams around each town. The difference between this method and that used

in method 2 is that the names of the towns are in column B while the number of dams close to the town

is in column A.

To find the answer to the question one can

EITHER

Scan the list of names looking for the town with the largest number of dams around it (i.e. 164). The list

is 581 rows long. If however, the list had been 5810 rows long this approach would be very time-

consuming so a shorter, more efficient method needs to be found.

OR

Sort the list in descending order according to the number of dams. Ceres, the town with the largest

number of dams around it will be at the top of the list.

OR

Use a combination of functions, especially if the list is a long list. For example one can use the MAX

function to determine this maximum value. Enter the following formula in in cell D2:

=MAX(B4:B585)

After pressing <Enter> a value of 164 will be displayed.

Because the order of the columns is different one can now use the VLOOKUP function. Enter the

following formula in cell D3:

22

=VLOOKUP(C2; A2:B585; 2; FALSE)

The answer will once again be Ceres.

Method 4 (using a pivot table):

A quicker approach to solving the problem would be to make use of a pivot table. Use “Nearest Town”

as the row labels and “Name of Dam” as the values to be counted (see the image on the next page).

This produces an ordered list of all the towns with the number of dams closest to each town (see image

below).

Row Labels Count of Name of dam

Aberdeen 20

Acornhoek 3

Addo 2

Adelaide 11

Albertinia 2

Alberton 1

Alice 7

Alicedale 3

Rather than scanning the whole list for the largest number of dams use the MAX function to determine

this maximum value. So place the following formula in in cell D4:

=MAX(B4:B587)

After pressing <Enter> a value of 164 will be displayed.

Unfortunately VLOOKUP does not allow one to search for a value other than a value in the first column.

Ideally what we would now want to do is to search the second column for the value 164 and read off the

corresponding value in the first column. The following formula when entered into cell D5 will solve the

problem:

=INDEX($A$4:$A$587, MATCH(D4, $B$4:$B$587, 0))

This method also gives Ceres as the answer.

23

C: DATABASE

South Africa is in the grip of its worst drought in more than a century. The levels of most of the country’s

major dams have decreased significantly over the past year with five provinces being declared disaster

areas and severe water restrictions being implemented countrywide. The database “SA Dams” contains

data, as on 15 February 2016, on some of the larger dams in South Africa. Carefully study the database

tables, including the field descriptions, and then answer the following questions.

The data is a collation of data obtained from the website of the Department of Water & Sanitation. The

actual readings were as reported on 15 February 2016.

(https://www.dwa.gov.za/hydrology/Weekly/Province.aspx)

1. How many dams are listed in the database? 208

Method 1:

Open the table “Dams”. In the Status Bar at the bottom of the screen you should see the following:

This will show the total number of records in the table, viz. 208

Method 2:

Create a simple query based on the Dams table. You can use any field. In the example given below the

field “DamName” has been used. Modify the query so that the number of dams is counted.

When the query is run the number of dams is displayed:

Method 3:

Open the table “Dams”. Physically count the number of records in the table.

24

2. On which river does the Clanwilliam Dam lie? Olifants River

Method 1 (uses filters):

Using the filter functionality in Access click on the arrowhead next to the “DamName” field. In the

dropdown window that opens de-select “(Select All)”. Then scroll down the list until you find “Clanwilliam

Dam” and select this. On clicking “OK” the record containing the name “Clanwilliam Dam” will be

displayed (see below).

This clearly shows that the Clanwilliam Dam lies on the Olifants River.

Method 2 (uses a text filter):

Using the filter functionality in Access click on the arrowhead next to the “DamName” field. In the

dropdown window that opens select “Text Filters” and “Contains” and then enter “Clanwilliam Dam” in

the window that opens (see below):

On clicking “OK” the record containing the name “Clanwilliam Dam” will be displayed (see image under

Method 1 above). This clearly shows that the Clanwilliam Dam lies on the Olifants River.

Method 3 (uses a simple query):

Create a simple query based on the Dams table. The only fields that will be required will be the

“DamName” field and the “RiverName” field. Insert “Clanwilliam Dam” in the criteria property in the

“DamName” field (see below):

When this query is run the following result is obtained:

This once again shows that the Clanwilliam Dam lies on the Olifants River.

25

Method 4:

Open the Dams table. Click on the Find icon in the ribbon. A window such as that shown below will

open:

Enter “Clanwilliam Dam” in the “Find What” field and make sure that the “Look In” field contains “Current

document”. When you click “Find Next” the record containing “Clanwilliam Dam” in one of its fields

opens. One can see the name “Olifants River” next to the name of the dam.

Method 5:

Open the Dams table. Highlight the “DamName” field by clicking on the field name. Click on the Find

icon in the ribbon. A window such as that shown below will open:

Enter “Clanwilliam Dam” in the “Find What” field and make sure that the “Look In” field contains “Current

field”. When you click “Find Next” the record containing “Clanwilliam Dam” in one of its fields opens. One

can see the name “Olifants River” next to the name of the dam.

26

3. How many of the dams rated as “Large” lie in the North West province? 5

Method 1 (uses filters):

Use the filter functionality built into Access. Click on the arrowhead next to the “Prov” field, de-select

“(Select All)” and select “NW” (the code for the North West Province) then “OK”. Then click on the

arrowhead next to the “DamRating” field, de-select “(Select All)” and select “Large” then “OK”.

The above actions will filter for the list of all the large dams in the North West province. The following list

will be displayed:

This shows the names of 5 dams.

The status bar at the bottom of the screen will also show

that 5 records are displayed.

Method 2 (uses a simple query):

Create a simple query based on the Dams table. The only fields that will be required will be the “Prov”

field and the “DamRating” field but in the example below the “DamName” and “RiverName” fields have

been included. Insert “NW” (for North West) in the criteria property in the “Prov” field and “Large” in the

criteria property of the “DamRating” field (see below).

When the query is run the following result is obtained:

This once again shows that 5 dams satisfy the given criteria.

27

4. Some areas of the country have had reasonable rainfall over the past year. How

many dams have more water in them now than they had at the same time last

year?

34

Method 1 (uses a query with a calculated field):

The figures to look at are contained in the “Week7” and “last year” fields. If the dam has more water in it

now than it had at the same time last year this will mean that [Week7] – [LastYear] is greater than 0.

Create a simple query based on the Dams table. The only fields that will be required will be the “Week7”

field and the “LastYear” field but in the example below the “DamName” and “RiverName” fields have

been included. A calculated field called “MoreThan” has been included where the calculation will be

[Week7] - [LastYear]

The criteria property in the calculated field should be set at “>0” (see image below).

When this query is run a list of the 34 dams that satisfy the given criteria is produced (see partial list in

the image below):

28

It is possible to change the format of the values in the “MoreThan” field by changing the format property

in the property sheet for this field. If fixed format is used the list will look as follows:

5. You are doing some research on multi-arch dam walls in the Eastern Cape. As you

will be onsite for at least one day you will need accommodation for at least one night.

What is the name of the town that is closest to a dam with the highest multi-arch wall

in the Eastern Cape?

Seymour

Method 1 (uses filters):

Use the filter functionality built into Access. Click on the arrowhead next to the “Prov” field, de-select

“(Select All)” and select “EC” (the code for the Eastern Cape). Then click on the arrowhead next to the

“WallType” field, de-select “(Select All)” and select “Multi-Arch”.

The above actions will filter for the list of all the multi-arch dams in the Eastern Cape. The following list of

three multi-arch dams in the Eastern Cape will be displayed. Of this list the dam with the highest wall

height is the Katrivier Dam where the closest town is Seymour only 3 km away: The answer is, therefore,

Seymour.

Method 2 (uses a simple query):

Create a simple query based on the Dams table. The fields that will be required will be the “Prov” field,

the “WallType” field, the “NearestTown” field, the “DistanceToTown” field and the “WallHeight” field.

Insert “EC” in the criteria property in the “Prov” field and “Multi-Arch” in the criteria property of the

“WallType” field (see next page).

29

When this query is run the following list is obtained:

Once again one can clearly see that the dam with the highest wall at 52 m is closest to Seymour, and so

Seymour is the answer.

6. South Africa is divided into 19 water management areas (WMA). The offices

in these areas are responsible for the management of all the dams in their

respective area. You’ve noticed a problem with water quality in the dams on

the Mooi River in Kwazulu-Natal and want to contact someone to report this.

What is the telephone number of the person responsible for these dams?

036-638-5100

Method 1 (uses filters):

In order to find the solution one needs to work with two of the tables in the database, viz. the Dams table

which contains details of the dams and the WMA table which contains details of the water management

areas and the persons responsible for managing them.

Use the filter functionality built into Access. Click on the arrowhead next to the “Prov” field, de-select

“(Select All)” and select “KN” (the code for Kwazulu-Natal). Then click on the arrowhead next to the

“RiverName” field, de-select “(Select All)” and select “Mooi River”.

The above actions will produce the following list of two dams on the Mooi River in the Kwazulu-Natal.

This list shows that the dams are in Water Management Area 7.

Now open the WMA table. Look for 7 in the “WMA” field. This record is linked to Corana Lubisi whose

telephone number is 036-638-5100.

30

Method 2 (uses a simple query):

Create a simple query based on the Dams table. The fields that will be required will be the “Prov” field,

the “RiverName” field and the “WMA” field. Insert “KN” in the criteria property in the “Prov” field and

“Mooi River” in the criteria property of the “RiverName” field (see below).

When this query is run it will produce the following list:

Once again this shows that the dams lie in Water Management Area 7. As with Method 1 you can then

open the WMA table and find out the necessary telephone number for the person responsible for this

Water Management Area.

Method 3 (uses a simple query across two tables):

Careful study of the database will show that the tables in the database are linked and so using this fact

one can construct a single query that will provide the answer. Add the WMA table to the query (see

image below):

31

Note the following:

the two tables are connected using the WMA code in each.

the field ContactNumber comes from the WMA table.

When this query is run the following list that now also includes the telephone number is obtained:

Once again one can see that the telephone number is 036-638-5100.

32

7. A drainage region is an area of land where surface water from rain or melting

snow converges to a single point at a lower elevation. Which drainage region

(A … X) has the largest number of rivers flowing through it? (NB. Rivers must

only be counted once in each drainage area.)

A

Method 1 (uses filters):

Use the filter functionality built into Access. Click on the arrowhead next to the “DrainageRegion” field

and sort all the records in ascending order. As there are only 20 drainage regions one can count the

number of occurrences of each in the ordered list. Doing this is time-consuming but the answer A (with

32 occurrences) will eventually be found – this is the answer.

Method 2 (uses a simple query with grouping and totals):

Create a simple query based on the Dams table. The fields that will be required will be the

“DrainageRegion” field and the “RiverName” field. Group the DrainageRegions and count the number of

rivers in each drainage region (see the query below):

When this query is run the following table is displayed:

This table indicates that there are 32 rivers in drainage region A, 23 rivers in drainage region B, etc.

Scanning this list, shows that the maximum number of rivers in a drainage region is 32 and that this

occurs in drainage region A – which is therefore the answer.

33

Method 3 (uses a CrossTab query):

One can also use a crosstab query to obtain the same result (see the diagrams starting below):

When <Next> is clicked the following query is automatically produced:

When this query is run the following list is produced:

Once again one notes that 32 is the maximum number of rivers in a drainage region and that these lie in

drainage region A. This query also provides the number of dams on each river.

34

Method 4 (uses a query-based report):

This problem can also be solved by creating a simple query and then creating a report based on the

query. The report should group the drainage areas and include an =COUNT([DrainageRegion]) in either

the group header or footer. A sample report could look something like the following:

Once again a quick scan of the report will show that drainage region A with 32 rivers has the most rivers

flowing through it. And so A is the correct answer.

35

D: HTML

Use the folders “css” and “images” as well as the html document “Wisegarden” to answer the following

questions. In each case write down only the letter of the most appropriate answer.

1. The text ‘Water-wise gardening’ is supposed to appear in the browser tab. What

element must be added to the <head> element of the document to achieve this?

A. <title>Water-wise gardening</title>

B. <tab>Water-wise gardening</tab>

C. <head>Water-wise gardening</head>

D. <header>Water-wise gardening</header>

A

Of the four options presented only option A using the <title>-tags is correct.

2. The background colour of the webpage is set in the stylesheet. How can the

background colour be changed to light yellow (#FFFFE0) using html instead of

the stylesheet?

A. Add the attribute background=”#FFFFE0” to the <html> tag

B. Add the attribute backcolor=”#FFFFE0” to the <body> tag

C. Add the attribute bgcolor=”FFFFE0” to the <body> tag

D. Add the attribute color=”FFFFE0” to the <head> tag

C

Of the four options presented only option C with the “bgcolor” attribute is correct.

3. The third image in the table (indigenous plants) does not display. Which TWO

corrections should be made to ensure that the image displays correctly?

A. Change the attribute sre to scr and the file extension to jpg

B. Change the attribute sre to src and the file extension to bmp

C. Change the attribute sre to scr and the file extension to png

D. Change the attribute sre to src and the file extension to jpg

D

Of the four options given only option D is correct. “sre” is not correct and needs to be changed to “src”

and the file extension for the file “indigenous” should be “jpg” and “jpeg” as given in the code.

4. Between which pair of tags is the cascading style sheet loaded?

A. <body> and </body>

B. <head> and </head>

C. <header> and </header>

D. <nav> and </nav>

B

Reference to the cascading style sheets (css) is made in line 6 of the code. This line appears between

the two <head>-tags and so option B is correct.