Specification Create a program that will simulate the work of citizen scientists who collect information about whales th
Posted: Sat May 14, 2022 3:51 pm
Specification
Create a program that will simulate the work of citizen
scientists who collect information about whales that visit the
eastern coast of Australia each year.
Background
For information about the whales, the tourists and marine
biologists rely on observation data gathered by volunteer citizen
scientists from four different locations along the eastern coast of
Australia (Eden, Jervis Bay, Byron Bay,
Hervey Bay). The citizen scientists are trained to
identify the main species of whales that visit this part of
Australia. Humpback, Minke, Southern
Right whales are the most common, and rarely seen are
Blue whales and Orcas (Killer Whales). Of
particular interest in recent years has been the sighting of
Migaloo, a male adult Humpback whale with an unusual white
colouring.
Each day during the whale watching season the citizen scientists
report details of any whale sightings at their location. For each
sighting the scientists report the species of whale, its direction
of travel, whether it is an adult or calf (baby whale) and if it
appears to be injured.
To give tourists an idea of the most likely places to see
whales, especially interesting whales (rare whales, calves, and
Migaloo) the citizen scientists’ observation data is used to
calculate a Whale Watching Location Desirability factor (WWLD). The
WWLD for each location is calculated for each location each day
with the observation data for the season.
Whale Watching simulation
The Whale Watching program will simulate one day of
observations.
The simulation begins with a welcome message.
The user is then prompted for the name of the citizen scientist
at each observation point. You may assume there is only one citizen
scientist at each observation point.
The numbers of adults and calves for each species of whale
(Humpback, Minke, Southern Right, Blue, Orca) that have been
observed at each location so far during the season are read from a
text file seasonObservations.txt. The file
has 4 lines, with 11 comma-separated numbers on each line. Each
line represents the location. Within each line, the numbers of
sightings of adults and calves for each species of whale are listed
in order and the last number is the number of sightings of Migaloo.
There is no other reading from the file during the
actual running of the program.
The program then sets up the whales in each of the four
locations for the current observations as follows:
(Hint: to calculate the probability of sighting a particular
species of whale, generate a random number from 1 to 100. There is
a 1% chance of each of these numbers being generated so you can
nominate numbers 1-50 for a Humpback, 51-75 for a Minke, etc.).
3. There is a 1% chance that a humpback
adult whale will be Migaloo, the white whale. Note that Migaloo can
only be
4. sighted at most once each day overall
locations.
5. The direction of travel of a whale is
north or south, with an equal probability of each.
6. If a whale is travelling south then it
may have an accompanying 0-1 calves, with each number having an
equal probability.
7. Each whale (adult or calf) has a 10%
chance of being injured.
The simulation considers each location in turn. At each location
the citizen scientist reports the whale sightings, the season
observations summary is updated and the WWLD is calculated. When
all locations have been visited, a summary of sightings from all
locations for the day is reported, the most desirable whale
watching location is reported and the updated season summary is
written back to the
file seasonObservationsUpdated.txt.
Specific actions at each location
At each location, the following actions are performed.
3. The season observations data is
updated.
4. The Whale Watching Location Desirability
factor (WWLD) for the location is calculated from the season
observation data, as follows:
WWLD = total_adults + 2 x total_calves + 4 x
total_rare_whales + 10 x Migaloo
Note: Blue whales and Orcas are considered to be rare
whales.
Specific actions at the completion of observations at
all locations
After the observations have been completed at all locations, the
following summary is displayed on the screen.
2. The most desirable location to
view whales, i.e. the location with the highest WWLD.
Contents in the seasonObservations.txt:
50,12,25,3,20,2,2,1,1,2,1
55,10,30,6,10,4,4,0,1,0,0
51,13,25,7,5,2,0,0,3,0,2
41,12,20,8,10,4,1,1,2,2,2
Thank you!!
Create a program that will simulate the work of citizen
scientists who collect information about whales that visit the
eastern coast of Australia each year.
Background
For information about the whales, the tourists and marine
biologists rely on observation data gathered by volunteer citizen
scientists from four different locations along the eastern coast of
Australia (Eden, Jervis Bay, Byron Bay,
Hervey Bay). The citizen scientists are trained to
identify the main species of whales that visit this part of
Australia. Humpback, Minke, Southern
Right whales are the most common, and rarely seen are
Blue whales and Orcas (Killer Whales). Of
particular interest in recent years has been the sighting of
Migaloo, a male adult Humpback whale with an unusual white
colouring.
Each day during the whale watching season the citizen scientists
report details of any whale sightings at their location. For each
sighting the scientists report the species of whale, its direction
of travel, whether it is an adult or calf (baby whale) and if it
appears to be injured.
To give tourists an idea of the most likely places to see
whales, especially interesting whales (rare whales, calves, and
Migaloo) the citizen scientists’ observation data is used to
calculate a Whale Watching Location Desirability factor (WWLD). The
WWLD for each location is calculated for each location each day
with the observation data for the season.
Whale Watching simulation
The Whale Watching program will simulate one day of
observations.
The simulation begins with a welcome message.
The user is then prompted for the name of the citizen scientist
at each observation point. You may assume there is only one citizen
scientist at each observation point.
The numbers of adults and calves for each species of whale
(Humpback, Minke, Southern Right, Blue, Orca) that have been
observed at each location so far during the season are read from a
text file seasonObservations.txt. The file
has 4 lines, with 11 comma-separated numbers on each line. Each
line represents the location. Within each line, the numbers of
sightings of adults and calves for each species of whale are listed
in order and the last number is the number of sightings of Migaloo.
There is no other reading from the file during the
actual running of the program.
The program then sets up the whales in each of the four
locations for the current observations as follows:
(Hint: to calculate the probability of sighting a particular
species of whale, generate a random number from 1 to 100. There is
a 1% chance of each of these numbers being generated so you can
nominate numbers 1-50 for a Humpback, 51-75 for a Minke, etc.).
3. There is a 1% chance that a humpback
adult whale will be Migaloo, the white whale. Note that Migaloo can
only be
4. sighted at most once each day overall
locations.
5. The direction of travel of a whale is
north or south, with an equal probability of each.
6. If a whale is travelling south then it
may have an accompanying 0-1 calves, with each number having an
equal probability.
7. Each whale (adult or calf) has a 10%
chance of being injured.
The simulation considers each location in turn. At each location
the citizen scientist reports the whale sightings, the season
observations summary is updated and the WWLD is calculated. When
all locations have been visited, a summary of sightings from all
locations for the day is reported, the most desirable whale
watching location is reported and the updated season summary is
written back to the
file seasonObservationsUpdated.txt.
Specific actions at each location
At each location, the following actions are performed.
3. The season observations data is
updated.
4. The Whale Watching Location Desirability
factor (WWLD) for the location is calculated from the season
observation data, as follows:
WWLD = total_adults + 2 x total_calves + 4 x
total_rare_whales + 10 x Migaloo
Note: Blue whales and Orcas are considered to be rare
whales.
Specific actions at the completion of observations at
all locations
After the observations have been completed at all locations, the
following summary is displayed on the screen.
2. The most desirable location to
view whales, i.e. the location with the highest WWLD.
Contents in the seasonObservations.txt:
50,12,25,3,20,2,2,1,1,2,1
55,10,30,6,10,4,4,0,1,0,0
51,13,25,7,5,2,0,0,3,0,2
41,12,20,8,10,4,1,1,2,2,2
Thank you!!