Académique Documents
Professionnel Documents
Culture Documents
Overview
This assignment is in two parts and each part will be submitted separately through the dropbox that
will be made available on Blackboard. Please keep up-to-date with announcements within Blackboard to
ensure that all that is required is submitted at the appropriate time.
• Test and debug your code to produce a robust application (ULO 4,5);
• Present a visualisation of the output from your program (ULO 1,2,3); and
Background
Today, in the vast majority of fields, data collection is very important and the data collection is closely
linked with location. It is this location aspect which makes the data “Spatial Data.”
In surveying and GIS, there are times where you have part of the location information but not all of it,
especially new unknonwn points. However, from the part that you have (observations in the field and
know coordinates) you are able to derive the coordinates of the unknown points. In this assignment you
will be provided with data that contains a location X0 (x0 , y0 ) and observations, a horizontal distance dh
and a bearing b. From this information you will need to calculate and display the location of the second
point X1 (x1 , y1 ). In the later part of the assignment you will be required to also calculate the height or
z1 value for X1 .
In this assignment you need to develop a program that calculates the location and height of the second
location. Your program will need to be able do the following things:
1. For point X1 calculate its coordinates (x1 , y1 ) using the coordinates of X0 , the bearing b and the
horizontal distance dh ;
Figure 1: The basic information. blue = known, green = observed, red = unknownto be calculated.
Assignment One
The assignment is broken down into several tasks. Each tasks flows into the next task. You should com-
plete the assignment task by task. As an example: understand what Task 2 requires; design a solution
for task 2, test that solution; fix any problems found in the solution; code the solution; debug, test and
document it. The following task generally requires the previous task to be completed as you slowly
build up the assignment until it is fully completed.
Task 0
Create a flowchart for the program design to be created. The steps that need to be covered in this flow
chart are Tasks 1 - 4.
Task 1
• a welcome message;
Task 2
Your program must now ask the user if they wish to continue or if they are finished. If the user has
finished then the program should exit otherwise your program should continue onto the next task.
1. the first message tells the user that they chose to continue; and
2. the second message tells the user that they chose to exit.
To complete this task define and use the function: def continue_finish():
Prior to implementing Task 3, the message to the user would be to tell them what they chose to do and
then your program will exit. After implementing task 3 the program will either exit or continue to Task
3.
Task 3
In this task you will ask the user to enter the following information:
To complete this task define and use the function: def user_input():
x0,y0,bearing,hor_dist = user_input():
Prior to implementing Task 4, the message to the user would be to tell them what they chose to do and
then your program will exit. After implementing task 4 the program will either exit or continue to Task
4.
Task 4
1. calculate the X coordinate of the second point, from the coordinates X0 (x0 , y0 ), the horizontal dis-
tance dh and the bearing b.
2. calculate the Y coordinate of the second point, from the coordinates Y( x0 , y0 ), the horizontal distance
dh and the bearing b.
These two functions use the input from the user gathered in Task 3. Display the results to the user in
a meaningful way.
Things to Note:
As you complete each Task, your program should carry out the new Task as well as all previous Tasks.
After successfully completing each Task, back up your code and begin on the next Task using a copy of
your program code. This way, you have a back up copy of your program that works so in the unlikely
event that you break your code and are unable to restore it to a working piece of software you still have
a working copy of the program.
Your code should be well documented using the 2 types of comments that have been discussed within
this unit: inline comments and block comments.
Due Date:
• Check unit outline
Deliverables:
Where to deliver:
Remember to save and back up your work before you log off.