Beruflich Dokumente
Kultur Dokumente
ENVIRONMENT
Department of Electrical & Electronic Engineering Technology
Student No
Student Signature
Marks Percentage
Total
Marks 50 100%
Student
Score
Instructions
Use comments in your programs where necessary.
Programs’ structure and indentation must be clearly aligned.
This paper has 2 printed pages including the cover page.
Page 1 of 2
A telecommunications company has requested you to write a program that can be used
to determine the coverage area for base transceiver stations (BTS). This is based
on determining the location of the transceiver, and the location at which signal
can be received from the transceiver. The following formula gives the distance
Distance = √(x −x ) +( y − y )
2 1
2
2 1
2
Given the location of the transceiver and the point at which signal can be
received, you can use this formula to find the radius of the coverage area by the
transceiver. Write a program that prompts the user to enter the location of the
transceiver, and the point at which signal can be received. The program should then
output the radius, diameter, circumference and the area covered by the transceiver.
Your program must have at least the following functions:
a) Input(): This function takes as its parameters, the four numbers that
represent the two points for location. This function is called from the
main() function to prompts the user to enter the four numbers, based on which
the parameters for the two locations are updated accordingly.
b) Distance(): This function takes as its parameters, the four numbers that
represent two points in the plane and returns the distance between them.
c) Radius(): This function takes as its parameters, the four numbers that
represent the transceiver location and a point at which signal can be
received. This calls the function Distance() to find the radius of the
coverage area, and returns the radius.
f) Area(): This function takes as its parameter a number that represents the
radius of the coverage area and returns area covered by the signal.
(NB: area = π x radius x radius)
Page 2 of 2