Click here to Skip to main content
15,906,567 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Write a program that uses x11/xlib interface to perform the following functions: Your program receive a file name as command line argument, this file consists of lines of the form

(137,296) 50,60;

That is the coordinates of the sensor in parantheses followed by its sensing radius and communication distance followed by a semicolon. The coordinates of all sensors are integers of the range 0-9999. Your program then prints the number of sensors it has read to stdout, opens a window and displays all the sensors and the bidirectional communication links. The sensor position itself is shown as a black dot, the communication link as a yellow segment and the covered region of the sensor as a red circle. Finally you test whether all points in the square are covered by sensors for this you can use an o(ncube) algorithm.
Posted
Updated 21-Apr-10 17:04pm
v3

This is clearly a homework question and you have to make an effort to solve it. I will certainly help you as soon as you tell me exactly what is it that you can't do. Are you having trouble reading the file? Or in showing the sensor network on a window?

-Saurabh
 
Share this answer
 
This reads like a homework assignment. We don't do homework for lazy people. We prefer them to fail BEFORE we have to carry them because they end up working where we work.
 
Share this answer
 
I think you can try Googling for it and you will certainly be able to find something relevant (if not exactly the same). Otherwise you can try it at your own and post the problem that you face, we will be more than happy to help you.
 
Share this answer
 
im unable toread the file and even i cannot view the window ,i have a windows os so is it necessary we shld have linux to run this program
 
Share this answer
 
thanku saurabh.garg for editing my question i request you to help me regarding my problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900